mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-15 20:29:52 +00:00
Refactoring CustomFields/CustomFieldChoice.php : indentation
This commit is contained in:
parent
4abb994725
commit
23438926b1
@ -69,8 +69,7 @@ class CustomFieldChoice implements CustomFieldInterface
|
|||||||
RequestStack $requestStack,
|
RequestStack $requestStack,
|
||||||
Translator $translator,
|
Translator $translator,
|
||||||
TwigEngine $templating,
|
TwigEngine $templating,
|
||||||
TranslatableStringHelper $translatableStringHelper
|
TranslatableStringHelper $translatableStringHelper)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$this->requestStack = $requestStack;
|
$this->requestStack = $requestStack;
|
||||||
$this->defaultLocales = $translator->getFallbackLocales();
|
$this->defaultLocales = $translator->getFallbackLocales();
|
||||||
@ -96,8 +95,7 @@ class CustomFieldChoice implements CustomFieldInterface
|
|||||||
'multiple' => $customFieldOptions[self::MULTIPLE],
|
'multiple' => $customFieldOptions[self::MULTIPLE],
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => $this->translatableStringHelper->localize($customField->getName())
|
'label' => $this->translatableStringHelper->localize($customField->getName()));
|
||||||
);
|
|
||||||
|
|
||||||
//if allow_other = true
|
//if allow_other = true
|
||||||
if ($customFieldOptions[self::ALLOW_OTHER] == true) {
|
if ($customFieldOptions[self::ALLOW_OTHER] == true) {
|
||||||
@ -131,13 +129,13 @@ class CustomFieldChoice implements CustomFieldInterface
|
|||||||
|
|
||||||
public function buildOptionsForm(FormBuilderInterface $builder)
|
public function buildOptionsForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add(self::MULTIPLE, 'choice', array(
|
$builder
|
||||||
|
->add(self::MULTIPLE, 'choice', array(
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
1 => 'Multiple',
|
1 => 'Multiple',
|
||||||
0 => 'Unique'
|
0 => 'Unique'),
|
||||||
),
|
|
||||||
'empty_data' => 0
|
'empty_data' => 0
|
||||||
))
|
))
|
||||||
->add(self::EXPANDED, 'choice', array(
|
->add(self::EXPANDED, 'choice', array(
|
||||||
@ -145,16 +143,14 @@ class CustomFieldChoice implements CustomFieldInterface
|
|||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
1 => 'Expanded',
|
1 => 'Expanded',
|
||||||
0 => 'Non expanded'
|
0 => 'Non expanded'),
|
||||||
),
|
|
||||||
'empty_data' => 0
|
'empty_data' => 0
|
||||||
))
|
))
|
||||||
->add(self::ALLOW_OTHER, 'choice', array(
|
->add(self::ALLOW_OTHER, 'choice', array(
|
||||||
'label' => 'Allow other',
|
'label' => 'Allow other',
|
||||||
'choices' => array(
|
'choices' => array(
|
||||||
0 => 'No',
|
0 => 'No',
|
||||||
1 => 'Yes'
|
1 => 'Yes'),
|
||||||
),
|
|
||||||
'empty_data' => 0,
|
'empty_data' => 0,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false
|
'multiple' => false
|
||||||
@ -164,8 +160,7 @@ class CustomFieldChoice implements CustomFieldInterface
|
|||||||
->add(self::CHOICES, new ChoicesType(), array(
|
->add(self::CHOICES, new ChoicesType(), array(
|
||||||
'type' => new ChoicesListType($this->defaultLocales),
|
'type' => new ChoicesListType($this->defaultLocales),
|
||||||
'allow_add' => true
|
'allow_add' => true
|
||||||
))
|
));
|
||||||
;
|
|
||||||
|
|
||||||
return $builder;
|
return $builder;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user