@@ -420,7 +420,7 @@ public function configureOptions(OptionsResolver $resolver)
420
420
$ resolver ->setAllowedTypes ('choice_value ' , array ('null ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
421
421
$ resolver ->setAllowedTypes ('choice_attr ' , array ('null ' , 'array ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
422
422
$ resolver ->setAllowedTypes ('preferred_choices ' , array ('array ' , '\Traversable ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
423
- $ resolver ->setAllowedTypes ('group_by ' , array ('null ' , 'array ' , ' \Traversable ' , ' callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
423
+ $ resolver ->setAllowedTypes ('group_by ' , array ('null ' , 'callable ' , 'string ' , 'Symfony\Component\PropertyAccess\PropertyPath ' ));
424
424
}
425
425
426
426
/**
@@ -431,21 +431,6 @@ public function getName()
431
431
return 'choice ' ;
432
432
}
433
433
434
- private static function flipRecursive ($ choices , &$ output = array ())
435
- {
436
- foreach ($ choices as $ key => $ value ) {
437
- if (is_array ($ value )) {
438
- $ output [$ key ] = array ();
439
- self ::flipRecursive ($ value , $ output [$ key ]);
440
- continue ;
441
- }
442
-
443
- $ output [$ value ] = $ key ;
444
- }
445
-
446
- return $ output ;
447
- }
448
-
449
434
/**
450
435
* Adds the sub fields for an expanded choice field.
451
436
*
@@ -503,14 +488,6 @@ private function addSubForm(FormBuilderInterface $builder, $name, ChoiceView $ch
503
488
504
489
private function createChoiceListView (ChoiceListInterface $ choiceList , array $ options )
505
490
{
506
- // If no explicit grouping information is given, use the structural
507
- // information from the "choices" option for creating groups
508
- if (!$ options ['group_by ' ] && $ options ['choices ' ]) {
509
- $ options ['group_by ' ] = !$ options ['choices_as_values ' ]
510
- ? self ::flipRecursive ($ options ['choices ' ])
511
- : $ options ['choices ' ];
512
- }
513
-
514
491
return $ this ->choiceListFactory ->createView (
515
492
$ choiceList ,
516
493
$ options ['preferred_choices ' ],
0 commit comments