You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
91
+
92
+
$value = function (array$choices) use ($value) {
93
+
return$value($choices);
94
+
};
95
+
96
+
return$value($choices);
89
97
}
90
98
91
99
if ($valueinstanceof PropertyPath) {
@@ -117,6 +125,12 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
130
+
131
+
$value = function ($choices) use ($value) {
132
+
return$value($choices);
133
+
};
120
134
}
121
135
122
136
if ($valueinstanceof PropertyPath) {
@@ -153,6 +167,13 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
172
+
173
+
$label = function ($choice) use ($label) {
174
+
return$label($choice);
175
+
};
176
+
156
177
}
157
178
158
179
if ($labelinstanceof PropertyPath) {
@@ -163,6 +184,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
163
184
164
185
if (is_string($preferredChoices) && !is_callable($preferredChoices)) {
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
189
+
190
+
$preferredChoices = function ($choice) use ($preferredChoices) {
191
+
return$preferredChoices($choice);
192
+
};
166
193
}
167
194
168
195
if ($preferredChoicesinstanceof PropertyPath) {
@@ -178,6 +205,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
210
+
211
+
$index = function ($choice) use ($index) {
212
+
return$index($choice);
213
+
};
181
214
}
182
215
183
216
if ($indexinstanceof PropertyPath) {
@@ -188,6 +221,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
188
221
189
222
if (is_string($groupBy) && !is_callable($groupBy)) {
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
226
+
227
+
$groupBy = function ($choice) use ($groupBy) {
228
+
return$groupBy($choice);
229
+
};
191
230
}
192
231
193
232
if ($groupByinstanceof PropertyPath) {
@@ -202,6 +241,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('Treating strings as callable is deprecated since version 3.1 and will throw an error in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
0 commit comments