The exception should be thrown if an object doesn't implement Traversable AND doesn't implement Countable, not when it doesn't implement Traversable but DOES implement Countable
This commit is contained in:
parent
a515383611
commit
8eea65e0d8
@ -140,7 +140,7 @@ class Question
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $values && !is_array($values)) {
|
if (null !== $values && !is_array($values)) {
|
||||||
if (!$values instanceof \Traversable || $values instanceof \Countable) {
|
if (!$values instanceof \Traversable || !$values instanceof \Countable) {
|
||||||
throw new \InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
|
throw new \InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user