remove deprecated templating component

This commit is contained in:
2023-07-22 23:05:34 +02:00
parent 4028cc8a8b
commit 7a5db59ac2
10 changed files with 29 additions and 45 deletions

View File

@@ -24,6 +24,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
use function array_key_exists;
use function count;
use function in_array;
@@ -42,20 +43,16 @@ class CustomFieldChoice extends AbstractCustomField
final public const OTHER_VALUE_LABEL = 'otherValueLabel';
private $defaultLocales;
/**
* CustomFieldChoice constructor.
*/
public function __construct(
TranslatorInterface $translator,
private readonly TwigEngine $templating,
private readonly Environment $templating,
/**
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private readonly TranslatableStringHelper $translatableStringHelper
) {
$this->defaultLocales = $translator->getFallbackLocales();
}
public function allowOtherChoice(CustomField $cf)
@@ -307,7 +304,6 @@ class CustomFieldChoice extends AbstractCustomField
'selected' => $selected,
'multiple' => $customField->getOptions()[self::MULTIPLE],
'expanded' => $customField->getOptions()[self::EXPANDED],
'locales' => $this->defaultLocales,
]
);
}