@@ -62,30 +62,6 @@ public static function generateHash($value, $namespace = '')
62
62
return hash ('sha256 ' , $ namespace .': ' .serialize ($ value ));
63
63
}
64
64
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
-
89
65
public function __construct (ChoiceListFactoryInterface $ decoratedFactory )
90
66
{
91
67
$ this ->decoratedFactory = $ decoratedFactory ;
@@ -113,12 +89,7 @@ public function createListFromChoices($choices, $value = null)
113
89
// The value is not validated on purpose. The decorated factory may
114
90
// decide which values to accept and which not.
115
91
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 ' );
122
93
123
94
if (!isset ($ this ->lists [$ hash ])) {
124
95
$ this ->lists [$ hash ] = $ this ->decoratedFactory ->createListFromChoices ($ choices , $ value );
0 commit comments