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('createListFromChoices() - 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
+
$value = function (array$choices) use ($value) {
92
+
return$value($choices);
93
+
};
94
+
95
+
return$value($choices);
89
96
}
90
97
91
98
if ($valueinstanceof PropertyPath) {
@@ -117,6 +124,11 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
@trigger_error('createListFromLoader() - 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);
129
+
$value = function ($choices) use ($value) {
130
+
return$value($choices);
131
+
};
120
132
}
121
133
122
134
if ($valueinstanceof PropertyPath) {
@@ -153,6 +165,13 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('createView() - $label - 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);
170
+
171
+
$label = function ($choice) use ($label) {
172
+
return$label($choice);
173
+
};
174
+
156
175
}
157
176
158
177
if ($labelinstanceof PropertyPath) {
@@ -163,6 +182,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
163
182
164
183
if (is_string($preferredChoices) && !is_callable($preferredChoices)) {
@trigger_error('createView() - $preferredChoices - 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);
187
+
188
+
$preferredChoices = function ($choice) use ($preferredChoices) {
189
+
return$preferredChoices($choice);
190
+
};
166
191
}
167
192
168
193
if ($preferredChoicesinstanceof PropertyPath) {
@@ -178,6 +203,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('createView() - $index - 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);
208
+
209
+
$index = function ($choice) use ($index) {
210
+
return$index($choice);
211
+
};
181
212
}
182
213
183
214
if ($indexinstanceof PropertyPath) {
@@ -188,6 +219,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
188
219
189
220
if (is_string($groupBy) && !is_callable($groupBy)) {
@trigger_error('createView() - $groupBy - 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);
224
+
225
+
$groupBy = function ($choice) use ($groupBy) {
226
+
return$groupBy($choice);
227
+
};
191
228
}
192
229
193
230
if ($groupByinstanceof PropertyPath) {
@@ -202,6 +239,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
@trigger_error('createView() - $attr - 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