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
@@ -746,13 +754,16 @@ public function offsetGet($option)
746
754
}
747
755
748
756
if (!$valid) {
749
-
$keys = array_keys($invalidTypes);
750
-
751
-
if (1 === \count($keys) && '[]' === substr($keys[0], -2)) {
752
-
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]));
753
-
}
754
-
755
-
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))));
757
+
thrownewInvalidOptionsException(
758
+
sprintf(
759
+
'The option "%s" with value %s is expected to be of type "%s", but %s of type "%s".',
760
+
$option,
761
+
$this->formatValue($value),
762
+
implode('" or "', $this->allowedTypes[$option]),
763
+
\is_array($value) && '[]' === substr($type, -2) ? 'one of the elements is' : 'is',
764
+
implode('|', $invalidTypes)
765
+
)
766
+
);
756
767
}
757
768
}
758
769
@@ -830,65 +841,35 @@ public function offsetGet($option)
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass[]".
510
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass|array|DateTime".
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer[][][][]".
1641
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer".
1641
1642
*/
1642
1643
publicfunctiontestNestedArraysException()
1643
1644
{
@@ -1659,7 +1660,7 @@ public function testNestedArraysException()
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]".
1663
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean|string|array".
1663
1664
*/
1664
1665
publicfunctiontestNestedArrayException1()
1665
1666
{
@@ -1674,7 +1675,7 @@ public function testNestedArrayException1()
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]".
1678
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean|string|array".
1678
1679
*/
1679
1680
publicfunctiontestNestedArrayException2()
1680
1681
{
@@ -1689,7 +1690,7 @@ public function testNestedArrayException2()
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string[][]".
1693
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string|integer".
1693
1694
*/
1694
1695
publicfunctiontestNestedArrayException3()
1695
1696
{
@@ -1704,7 +1705,7 @@ public function testNestedArrayException3()
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer[][][]".
1708
+
* @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer".
1708
1709
*/
1709
1710
publicfunctiontestNestedArrayException4()
1710
1711
{
@@ -1720,7 +1721,7 @@ public function testNestedArrayException4()
0 commit comments