mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-16 10:59:31 +00:00
apply rector rules
This commit is contained in:
@@ -12,31 +12,15 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Templating;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\Extension\ExtensionInterface;
|
||||
|
||||
class TranslatableStringTwig extends AbstractExtension
|
||||
class TranslatableStringTwig
|
||||
{
|
||||
/**
|
||||
* TranslatableStringTwig constructor.
|
||||
*/
|
||||
public function __construct(private readonly TranslatableStringHelper $helper) {}
|
||||
|
||||
/**
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* (non-PHPdoc)
|
||||
*
|
||||
* @see Twig_Extension::getFilters()
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new TwigFilter(
|
||||
'localize_translatable_string',
|
||||
$this->localize(...)
|
||||
), ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the extension.
|
||||
*/
|
||||
@@ -45,6 +29,7 @@ class TranslatableStringTwig extends AbstractExtension
|
||||
return 'chill_main_localize';
|
||||
}
|
||||
|
||||
#[\Twig\Attribute\AsTwigFilter('localize_translatable_string')]
|
||||
public function localize(array $translatableStrings): ?string
|
||||
{
|
||||
return $this->helper
|
||||
|
||||
Reference in New Issue
Block a user