mirror of
https://github.com/flextype/flextype.git
synced 2025-08-06 13:16:45 +02:00
refactor(core): fix code standard for twig extensions #347
This commit is contained in:
@@ -9,7 +9,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Slim\Csrf\Guard;
|
||||
use Twig_Extension;
|
||||
use Twig_Extension_GlobalsInterface;
|
||||
use Twig_SimpleFunction;
|
||||
|
@@ -87,12 +87,14 @@ class DateTwigExtension extends Twig_Extension
|
||||
} else {
|
||||
$js_format .= '\'' . $php_format[$i];
|
||||
}
|
||||
|
||||
$escaping = true;
|
||||
} else {
|
||||
if ($escaping) {
|
||||
$js_format .= "'";
|
||||
$escaping = false;
|
||||
}
|
||||
|
||||
if (isset($symbols_matching[$char])) {
|
||||
$js_format .= $symbols_matching[$char];
|
||||
} else {
|
||||
|
@@ -43,7 +43,7 @@ class I18nTwigExtension extends Twig_Extension
|
||||
/**
|
||||
* Translate string
|
||||
*/
|
||||
public function tr(string $translate, array $values = [], string $locale = null) : string
|
||||
public function tr(string $translate, array $values = [], ?string $locale = null) : string
|
||||
{
|
||||
return I18n::find($translate, $values, $locale);
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@ declare(strict_types=1);
|
||||
namespace Flextype;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig_SimpleFilter;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
class JsonTwigExtension extends Twig_Extension
|
||||
{
|
||||
|
@@ -10,8 +10,8 @@ declare(strict_types=1);
|
||||
namespace Flextype;
|
||||
|
||||
use Twig_Extension;
|
||||
use Twig_SimpleFunction;
|
||||
use Twig_SimpleFilter;
|
||||
use Twig_SimpleFunction;
|
||||
|
||||
class YamlTwigExtension extends Twig_Extension
|
||||
{
|
||||
|
Reference in New Issue
Block a user