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
@@ -552,8 +552,9 @@ public function setAllowedValues($option, $allowedValues)
552
552
thrownewAccessException('Allowed values cannot be set from a lazy option or normalizer.');
553
553
}
554
554
555
-
// Not supported for nested options
556
555
if ($this->isNested($option)) {
556
+
@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);
557
+
557
558
return$this;
558
559
}
559
560
@@ -602,8 +603,9 @@ public function addAllowedValues($option, $allowedValues)
602
603
thrownewAccessException('Allowed values cannot be added from a lazy option or normalizer.');
603
604
}
604
605
605
-
// Not supported for nested options
606
606
if ($this->isNested($option)) {
607
+
@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);
608
+
607
609
return$this;
608
610
}
609
611
@@ -652,8 +654,9 @@ public function setAllowedTypes($option, $allowedTypes)
652
654
thrownewAccessException('Allowed types cannot be set from a lazy option or normalizer.');
653
655
}
654
656
655
-
// Not supported for nested options
656
657
if ($this->isNested($option)) {
658
+
@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);
659
+
657
660
return$this;
658
661
}
659
662
@@ -696,8 +699,9 @@ public function addAllowedTypes($option, $allowedTypes)
696
699
thrownewAccessException('Allowed types cannot be added from a lazy option or normalizer.');
697
700
}
698
701
699
-
// Not supported for nested options
700
702
if ($this->isNested($option)) {
703
+
@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