@@ -61,7 +61,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
61
61
$ choiceList = $ this ->createChoiceList ($ options );
62
62
$ builder ->setAttribute ('choice_list ' , $ choiceList );
63
63
64
- if ($ options ['expanded ' ] && !in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ))) {
64
+ if ($ options ['expanded ' ] && !in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ), true )) {
65
65
$ builder ->setDataMapper ($ options ['multiple ' ]
66
66
? new CheckboxListMapper ($ choiceList )
67
67
: new RadioListMapper ($ choiceList ));
@@ -151,7 +151,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
151
151
$ builder ->addViewTransformer (new ChoicesToValuesTransformer ($ choiceList ));
152
152
153
153
// for "text" / "hidden" widget, view data uses a delimiter
154
- if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ))) {
154
+ if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ), true )) {
155
155
$ builder ->addViewTransformer (new ValuesToStringTransformer ($ options ['delimiter ' ], $ options ['trim ' ]));
156
156
}
157
157
} else {
@@ -195,7 +195,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
195
195
'choice_translation_domain ' => $ choiceTranslationDomain ,
196
196
));
197
197
198
- if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ))) {
198
+ if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ), true )) {
199
199
return ;
200
200
}
201
201
@@ -237,7 +237,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
237
237
*/
238
238
public function finishView (FormView $ view , FormInterface $ form , array $ options )
239
239
{
240
- if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ))) {
240
+ if (in_array ($ options ['widget ' ], array ('text ' , 'hidden ' ), true )) {
241
241
return ;
242
242
}
243
243
@@ -318,8 +318,8 @@ public function configureOptions(OptionsResolver $resolver)
318
318
};
319
319
320
320
$ multipleNormalizer = function (Options $ options , $ multiple ) {
321
- if (in_array ($ options ['widget ' ], array ('radio ' , 'checkbox ' ))) {
322
- return 'checkbox ' == $ options ['widget ' ];
321
+ if (in_array ($ options ['widget ' ], array ('radio ' , 'checkbox ' ), true )) {
322
+ return 'checkbox ' === $ options ['widget ' ];
323
323
}
324
324
325
325
return $ multiple ;
@@ -332,7 +332,7 @@ public function configureOptions(OptionsResolver $resolver)
332
332
$ expanded = false ;
333
333
}
334
334
335
- return in_array ($ options ['widget ' ], array ('radio ' , 'checkbox ' )) ?: $ expanded ;
335
+ return in_array ($ options ['widget ' ], array ('radio ' , 'checkbox ' ), true ) ?: $ expanded ;
336
336
};
337
337
338
338
$ resolver ->setDefaults (array (
@@ -376,6 +376,7 @@ public function configureOptions(OptionsResolver $resolver)
376
376
$ resolver ->setAllowedTypes ('choice_attr ' , array ('null ' , 'array ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
377
377
$ resolver ->setAllowedTypes ('preferred_choices ' , array ('array ' , '\Traversable ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
378
378
$ resolver ->setAllowedTypes ('group_by ' , array ('null ' , 'array ' , '\Traversable ' , 'string ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
379
+ $ resolver ->setAllowedValues ('widget ' , array (null , 'hidden ' , 'text ' , 'select ' , 'checkbox ' , 'radio ' ));
379
380
}
380
381
381
382
/**
0 commit comments