Skip to content

Commit 417b520

Browse files
Robin Kantersfabpot
authored andcommitted
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
1 parent 0b296b2 commit 417b520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Question/Question.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function setAutocompleterValues($values)
140140
}
141141

142142
if (null !== $values && !is_array($values)) {
143-
if (!$values instanceof \Traversable || $values instanceof \Countable) {
143+
if (!$values instanceof \Traversable || !$values instanceof \Countable) {
144144
throw new \InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
145145
}
146146
}

0 commit comments

Comments
 (0)