10000 The exception should be thrown if an object doesn't implement Travers… · symfony/symfony@8eea65e · GitHub
[go: up one dir, main page]

Skip to content

Commit 8eea65e

Browse files
Robin Kantersfabpot
Robin Kanters
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 a515383 commit 8eea65e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/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)
0