8000 [OptionsResolver] add missing deprecation triggers by Tobion · Pull Request #13809 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[OptionsResolver] add missing deprecation triggers #13809

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
Changes from 1 commit
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
Next Next commit
[OptionsResolver] add missing deprecation triggers
  • Loading branch information
Tobion committed Feb 27, 2015
commit 7e9d2e618b6d513fb88076cf62739393dc806173
10 changes: 10 additions & 0 deletions src/Symfony/Component/OptionsResolver/OptionsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ public function setNormalizer($option, \Closure $normalizer)
*/
public function setNormalizers(array $normalizers)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use setNormalizer() instead.', E_USER_DEPRECATED);

foreach ($normalizers as $option => $normalizer) {
$this->setNormalizer($option, $normalizer);
}
Expand Down Expand Up @@ -464,6 +466,8 @@ public function setAllowedValues($option, $allowedValues = null)

// BC
if (is_array($option) && null === $allowedValues) {
trigger_error('Calling the '.__METHOD__.' method with an array options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: array of options


foreach ($option as $optionName => $optionValues) {
$this->setAllowedValues($optionName, $optionValues);
}
Expand Down 8000 Expand Up @@ -518,6 +522,8 @@ public function addAllowedValues($option, $allowedValues = null)

// BC
if (is_array($option) && null === $allowedValues) {
trigger_error('Calling the '.__METHOD__.' method with an array options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);

foreach ($option as $optionName => $optionValues) {
$this->addAllowedValues($optionName, $optionValues);
}
Expand Down Expand Up @@ -570,6 +576,8 @@ public function setAllowedTypes($option, $allowedTypes = null)

// BC
if (is_array($option) && null === $allowedTypes) {
trigger_error('Calling the '.__METHOD__.' method with an array options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);

foreach ($option as $optionName => $optionTypes) {
$this->setAllowedTypes($optionName, $optionTypes);
}
Expand Down Expand Up @@ -618,6 +626,8 @@ public function addAllowedTypes($option, $allowedTypes = null)

// BC
if (is_array($option) && null === $allowedTypes) {
trigger_error('Calling the '.__METHOD__.' method with an array options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.', E_USER_DEPRECATED);

foreach ($option as $optionName => $optionTypes) {
$this->addAllowedTypes($optionName, $optionTypes);
}
Expand Down
0