Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9255f75

Browse files
author
hamza
committed
#17993 - Change message and adding empty line
1 parent 61707b8 commit 9255f75

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
164164
if (is_string($label) && !is_callable($label)) {
165165
$label = new PropertyPath($label);
166166
} elseif (is_string($label) && is_callable($label)) {
167-
@trigger_error('createView() - $label - treats callable strings as callable and is deprecated since version 3.1.', E_USER_DEPRECATED);
167+
@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+
168169
$label = function ($choice) use ($label) {
169170
return $label($choice);
170171
};
@@ -179,7 +180,8 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
179180
if (is_string($preferredChoices) && !is_callable($preferredChoices)) {
180181
$preferredChoices = new PropertyPath($preferredChoices);
181182
} elseif (is_string($preferredChoices) && is_callable($preferredChoices)) {
182-
@trigger_error('createView() - $preferredChoices - treats callable strings as callable and is deprecated since version 3.1.', E_USER_DEPRECATED);
183+
@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+
183185
$preferredChoices = function ($choice) use ($preferredChoices) {
184186
return $preferredChoices($choice);
185187
};
@@ -199,7 +201,8 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
199201
if (is_string($index) && !is_callable($index)) {
200202
$index = new PropertyPath($index);
201203
} elseif (is_string($index) && is_callable($index)) {
202-
@trigger_error('createView() - $index - treats callable strings as callable and is deprecated since version 3.1.', E_USER_DEPRECATED);
204+
@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+
203206
$index = function ($choice) use ($index) {
204207
return $index($choice);
205208
};
@@ -214,7 +217,8 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
214217
if (is_string($groupBy) && !is_callable($groupBy)) {
215218
$groupBy = new PropertyPath($groupBy);
216219
} elseif (is_string($groupBy) && is_callable($groupBy)) {
217-
@trigger_error('createView() - $groupBy - treats callable strings as callable and is deprecated since version 3.1.', E_USER_DEPRECATED);
220+
@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+
218222
$groupBy = function ($choice) use ($groupBy) {
219223
return $groupBy($choice);
220224
};
@@ -233,7 +237,8 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
233237
if (is_string($attr) && !is_callable($attr)) {
234238
$attr = new PropertyPath($attr);
235239
} elseif (is_string($attr) && is_callable($attr)) {
236-
@trigger_error('createView() - $attr - treats callable strings as callable and is deprecated since version 3.1.', E_USER_DEPRECATED);
240+
@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);
241+
237242
$attr = function ($choice) use ($attr) {
238243
return $attr($choice);
239244
};

0 commit comments

Comments
 (0)