mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
remove unused locale and request stack
The locale resolving is delegated to TranslatableStringHelper
This commit is contained in:
parent
9bf7b4ac60
commit
b97a550e2b
@ -45,12 +45,6 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
const MULTIPLE = 'multiple';
|
||||
const EXPANDED = 'expanded';
|
||||
const CHOICES = 'choices';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var RequestStack
|
||||
*/
|
||||
private $requestStack;
|
||||
|
||||
private $defaultLocales;
|
||||
|
||||
@ -66,12 +60,10 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
private $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
RequestStack $requestStack,
|
||||
Translator $translator,
|
||||
TwigEngine $templating,
|
||||
TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->defaultLocales = $translator->getFallbackLocales();
|
||||
$this->templating = $templating;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
@ -80,7 +72,6 @@ class CustomFieldChoice extends AbstractCustomField
|
||||
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
||||
{
|
||||
//prepare choices
|
||||
$locale = $this->requestStack->getCurrentRequest()->getLocale();
|
||||
$choices = array();
|
||||
$customFieldOptions = $customField->getOptions();
|
||||
|
||||
|
@ -61,7 +61,6 @@ services:
|
||||
chill.custom_field.choice:
|
||||
class: Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
- "@translator.default"
|
||||
- "@templating"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
|
Loading…
x
Reference in New Issue
Block a user