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
Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -292,9 +292,11 @@ public function configureOptions(OptionsResolver $resolver)
292
292
return;
293
293
};
294
294
295
-
$choiceListNormalizer = function (Options$options, $choiceList) use ($choiceListFactory) {
295
+
// Hack to use the $this variable inside a Closure with PHP 5.3.
296
+
$that = $this;
297
+
$choiceListNormalizer = function (Options$options, $choiceList) use ($choiceListFactory, $that) {
296
298
if ($choiceList) {
297
-
@trigger_error('The "choice_list" option is deprecated since version 2.7 and will be removed in 3.0. Use "choice_loader" instead.', E_USER_DEPRECATED);
299
+
@trigger_error(sprintf('The "choice_list" option of "%s" (%s) is deprecated since version 2.7 and will be removed in 3.0. Use "choice_loader" instead.', $that->getName(), __CLASS__), E_USER_DEPRECATED);
298
300
299
301
if ($choiceListinstanceof LegacyChoiceListInterface) {
300
302
returnnewLegacyChoiceListAdapter($choiceList);
@@ -321,9 +323,11 @@ public function configureOptions(OptionsResolver $resolver)
$placeholderNormalizer = function (Options$options, $placeholder) {
326
+
// See $that = $this; statement above for the "choice_list" option deprecation.
327
+
// It allows to use the $this variable inside a Closure with PHP 5.3.
328
+
$placeholderNormalizer = function (Options$options, $placeholder) use ($that) {
325
329
if (!is_object($options['empty_value']) || !$options['empty_value'] instanceof \Exception) {
326
-
@trigger_error('The form option "empty_value" is deprecated since version 2.6 and will be removed in 3.0. Use "placeholder" instead.', E_USER_DEPRECATED);
330
+
@trigger_error(sprintf('The form option "empty_value" of "%s" (%s) is deprecated since version 2.6 and will be removed in 3.0. Use "placeholder" instead.', $that->getName(), __CLASS__), E_USER_DEPRECATED);
0 commit comments