Skip to content

Commit

Permalink
[Form] improve deprecation message for "empty_value" and "choice_list…
Browse files Browse the repository at this point in the history
…" options.
  • Loading branch information
Hugo Hamon committed Dec 23, 2015
1 parent 3bb3f3b commit f0a0aff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function configureOptions(OptionsResolver $resolver)

$choiceListNormalizer = function (Options $options, $choiceList) use ($choiceListFactory) {
if ($choiceList) {
@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);
@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.', get_class($this)), E_USER_DEPRECATED);

if ($choiceList instanceof LegacyChoiceListInterface) {
return new LegacyChoiceListAdapter($choiceList);
Expand Down Expand Up @@ -323,7 +323,7 @@ public function configureOptions(OptionsResolver $resolver)

$placeholderNormalizer = function (Options $options, $placeholder) {
if (!is_object($options['empty_value']) || !$options['empty_value'] instanceof \Exception) {
@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);
@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.', get_class($this)), E_USER_DEPRECATED);

$placeholder = $options['empty_value'];
}
Expand Down

0 comments on commit f0a0aff

Please sign in to comment.