You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/OptionsResolver/OptionsResolver.php
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -549,8 +549,9 @@ public function setAllowedValues($option, $allowedValues)
549
549
thrownewAccessException('Allowed values cannot be set from a lazy option or normalizer.');
550
550
}
551
551
552
-
// Not supported for nested options
553
552
if ($this->isNested($option)) {
553
+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for values %s', __METHOD__, $option, $this->formatValues($allowedValues)), E_USER_WARNING);
554
+
554
555
return$this;
555
556
}
556
557
@@ -599,8 +600,9 @@ public function addAllowedValues($option, $allowedValues)
599
600
thrownewAccessException('Allowed values cannot be added from a lazy option or normalizer.');
600
601
}
601
602
602
-
// Not supported for nested options
603
603
if ($this->isNested($option)) {
604
+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for values %s', __METHOD__, $option, $this->formatValues($allowedValues)), E_USER_WARNING);
605
+
604
606
return$this;
605
607
}
606
608
@@ -649,8 +651,9 @@ public function setAllowedTypes($option, $allowedTypes)
649
651
thrownewAccessException('Allowed types cannot be set from a lazy option or normalizer.');
650
652
}
651
653
652
-
// Not supported for nested options
653
654
if ($this->isNested($option)) {
655
+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for types %s', __METHOD__, $option, $this->formatValues($allowedTypes)), E_USER_WARNING);
656
+
654
657
return$this;
655
658
}
656
659
@@ -693,8 +696,9 @@ public function addAllowedTypes($option, $allowedTypes)
693
696
thrownewAccessException('Allowed types cannot be added from a lazy option or normalizer.');
694
697
}
695
698
696
-
// Not supported for nested options
697
699
if ($this->isNested($option)) {
700
+
@trigger_error(sprintf('The "%s" method should not be used with nested options. A failed attempt occurred with the option "%" for types %s', __METHOD__, $option, $this->formatValues($allowedTypes)), E_USER_WARNING);
0 commit comments