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
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix traversable autocomplete values
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->
`Question::setAutocompleterValues` implies passing a `\Traversable` value is allowed, yet it doesnt work :) It also restricts the traversable to be countable, which is not really needed (blocking pure API / iterable type as of 4.0).
Commits
-------
965b5b5 [Console] Fix traversable autocomplete values
if (!$valuesinstanceof \Traversable || !$valuesinstanceof \Countable) {
142
-
thrownew \InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
143
-
}
140
+
if (null !== $values && !is_array($values) && !$valuesinstanceof \Traversable) {
141
+
thrownew \InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');
0 commit comments