8000 [OptionsResolver] add missing deprecation triggers · symfony/symfony@7e9d2e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e9d2e6

Browse files
committed
[OptionsResolver] add missing deprecation triggers
1 parent 469e70d commit 7e9d2e6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ public function setNormalizer($option, \Closure $normalizer)
428428
*/
429429
public function setNormalizers(array $normalizers)
430430
{
431+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use setNormalizer() instead.', E_USER_DEPRECATED);
432+
431433
foreach ($normalizers as $option => $normalizer) {
432434
$this->setNormalizer($option, $normalizer);
433435
}
@@ -464,6 +466,8 @@ public function setAllowedValues($option, $allowedValues = null)
464466

465467
// BC
466468
if (is_array($option) && null === $allowedValues) {
469+
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);
470+
467471
foreach ($option as $optionName => $optionValues) {
468472
$this->setAllowedValues($optionName, $optionValues);
469473
}
@@ -518,6 +522,8 @@ public function addAllowedValues($option, $allowedValues = null)
518522

519523
// BC
520524
if (is_array($option) && null === $allowedValues) {
525+
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);
526+
521527
foreach ($option as $optionName => $optionValues) {
522528
$this->addAllowedValues($optionName, $optionValues);
523529
}
@@ -570,6 +576,8 @@ public function setAllowedTypes($option, $allowedTypes = null)
570576

571577
// BC
572578
if (is_array($option) && null === $allowedTypes) {
579+
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);
580+
573581
foreach ($option as $optionName => $optionTypes) {
574582
$this->setAllowedTypes($optionName, $optionTypes);
575583
}
@@ -618,6 +626,8 @@ public function addAllowedTypes($option, $allowedTypes = null)
618626

619627
// BC
620628
if (is_array($option) && null === $allowedTypes) {
629+
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);
630+
621631
foreach ($option as $optionName => $optionTypes) {
622632
$this->addAllowedTypes($optionName, $optionTypes);
623633
}

0 commit comments

Comments
 (0)
0