8000 [Form] improve deprecation message for "empty_value" and "choice_list… · symfony/symfony@ff26475 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff26475

Browse files
author
Hugo Hamon
committed
[Form] improve deprecation message for "empty_value" and "choice_list" options.
1 parent 3bb3f3b commit ff26475

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public function configureOptions(OptionsResolver $resolver)
294294

295295
$choiceListNormalizer = function (Options $options, $choiceList) use ($choiceListFactory) {
296296
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);
297+
@trigger_error(sprintf('The "choice_list" option of a %s form type is deprecated since version 2.7 and will be removed in 3.0. Use "choice_loader" instead.', __CLASS__), E_USER_DEPRECATED);
298298

299299
if ($choiceList instanceof LegacyChoiceListInterface) {
300300
return new LegacyChoiceListAdapter($choiceList);
@@ -323,7 +323,7 @@ public function configureOptions(OptionsResolver $resolver)
323323

324324
$placeholderNormalizer = function (Options $options, $placeholder) {
325325
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);
326+
@trigger_error(sprintf('The form option "empty_value" of a %s form type is deprecated since version 2.6 and will be removed in 3.0. Use "placeholder" instead.', __CLASS__), E_USER_DEPRECATED);
327327

328328
$placeholder = $options['empty_value'];
329329
}

0 commit comments

Comments
 (0)
0