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
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -785,14 +785,13 @@ public function offsetGet($option)
785
785
}
786
786
787
787
if (!$valid) {
788
-
thrownewInvalidOptionsException(sprintf(
789
-
'The option "%s" with value %s is expected to be of type '.
790
-
'"%s", but is of type "%s".',
791
-
$option,
792
-
$this->formatValue($value),
793
-
implode('" or "', $this->allowedTypes[$option]),
794
-
implode('|', array_keys($invalidTypes))
795
-
));
788
+
$keys = array_keys($invalidTypes);
789
+
790
+
if (1 === \count($keys) && '[]' === substr($keys[0], -2)) {
791
+
thrownewInvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), implode('|', array_keys($invalidTypes))));
792
+
}
793
+
794
+
thrownewInvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), implode('|', array_keys($invalidTypes))));
796
795
}
797
796
}
798
797
@@ -878,19 +877,7 @@ public function offsetGet($option)
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but is of type "integer[][][][]".
1704
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer[][][][]".
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string[][]".
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer[][][]".
0 commit comments