8000 [Form] Deprecate the "choices_as_values" option of ChoiceType by nicolas-grekas · Pull Request #16994 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Deprecate the "choices_as_values" option of ChoiceType #16994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

3.1.0
-----

* deprecated the "choices_as_values" option of ChoiceType

3.0.0
-----

Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ public function configureOptions(OptionsResolver $resolver)
throw new \RuntimeException('The "choices_as_values" option should not be used. Remove it and flip the contents of the "choices" option instead.');
}

// To be uncommented in 3.1
//@trigger_error('The "choices_as_values" option is deprecated since version 3.1 and will be removed in 4.0. You should not use it anymore.', E_USER_DEPRECATED);
@trigger_error('The "choices_as_values" option is deprecated since version 3.1 and will be removed in 4.0. You should not use it anymore.', E_USER_DEPRECATED);

return true;
};
Expand Down Expand Up @@ -302,7 +301,7 @@ public function configureOptions(OptionsResolver $resolver)
'multiple' => false,
'expanded' => false,
'choices' => array(),
'choices_as_values' => null, // to be deprecated in 3.1
'choices_as_values' => null, // deprecated since 3.1
'choice_loader' => null,
'choice_label' => null,
'choice_name' => null,
Expand Down
0