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
@@ -843,14 +843,13 @@ public function offsetGet($option)
843
843
}
844
844
845
845
if (!$valid) {
846
-
thrownewInvalidOptionsException(sprintf(
847
-
'The option "%s" with value %s is expected to be of type '.
848
-
'"%s", but is of type "%s".',
849
-
$option,
850
-
$this->formatValue($value),
851
-
implode('" or "', $this->allowedTypes[$option]),
852
-
implode('|', array_keys($invalidTypes))
853
-
));
846
+
$keys = array_keys($invalidTypes);
847
+
848
+
if (1 === \count($keys) && '[]' === substr($keys[0], -2)) {
849
+
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]), $keys[0]));
850
+
}
851
+
852
+
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))));
854
853
}
855
854
}
856
855
@@ -939,32 +938,10 @@ public function offsetGet($option)
* @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