@@ -62,30 +62,6 @@ public static function generateHash($value, $namespace = '')
6262 return hash ('sha256 ' , $ namespace .': ' .serialize ($ value ));
6363 }
6464
65- /**
66- * Flattens an array into the given output variable.
67- *
68- * @param array $array The array to flatten
69- * @param array $output The flattened output
70- *
71- * @internal
72- */
73- private static function flatten (array $ array , &$ output )
74- {
75- if (null === $ output ) {
76- $ output = array ();
77- }
78-
79- foreach ($ array as $ key => $ value ) {
80- if (\is_array ($ value )) {
81- self ::flatten ($ value , $ output );
82- continue ;
83- }
84-
85- $ output [$ key ] = $ value ;
86- }
87- }
88-
8965 public function __construct (ChoiceListFactoryInterface $ decoratedFactory )
9066 {
9167 $ this ->decoratedFactory = $ decoratedFactory ;
@@ -113,12 +89,7 @@ public function createListFromChoices($choices, $value = null)
11389 // The value is not validated on purpose. The decorated factory may
11490 // decide which values to accept and which not.
11591
116- // We ignore the choice groups for caching. If two choice lists are
117- // requested with the same choices, but a different grouping, the same
118- // choice list is returned.
119- self ::flatten ($ choices , $ flatChoices );
120-
121- $ hash = self ::generateHash (array ($ flatChoices , $ value ), 'fromChoices ' );
92+ $ hash = self ::generateHash (array ($ choices , $ value ), 'fromChoices ' );
12293
12394 if (!isset ($ this ->lists [$ hash ])) {
12495 $ this ->lists [$ hash ] = $ this ->decoratedFactory ->createListFromChoices ($ choices , $ value );
0 commit comments