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('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);
168
+
169
+
$label = function ($choice) use ($label) {
170
+
return$label($choice);
171
+
};
156
172
}
157
173
158
174
if ($labelinstanceof PropertyPath) {
@@ -163,6 +179,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
163
179
164
180
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);
184
+
185
+
$preferredChoices = function ($choice) use ($preferredChoices) {
186
+
return$preferredChoices($choice);
187
+
};
166
188
}
167
189
168
190
if ($preferredChoicesinstanceof PropertyPath) {
@@ -178,6 +200,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);
205
+
206
+
$index = function ($choice) use ($index) {
207
+
return$index($choice);
208
+
};
181
209
}
182
210
183
211
if ($indexinstanceof PropertyPath) {
@@ -188,6 +216,12 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
188
216
189
217
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);
221
+
222
+
$groupBy = function ($choice) use ($groupBy) {
223
+
return$groupBy($choice);
224
+
};
191
225
}
192
226
193
227
if ($groupByinstanceof PropertyPath) {
@@ -202,6 +236,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