12 namespace Symfony\Component\Console\Question;
83 if ($this->autocompleterValues) {
84 throw new \LogicException(
'A hidden question cannot use the autocompleter.');
111 $this->hiddenFallback = (bool) $fallback;
138 if (is_array($values) && $this->
isAssoc($values)) {
139 $values = array_merge(array_keys($values), array_values($values));
142 if (null !== $values && !is_array($values)) {
143 if (!$values instanceof \Traversable || $values instanceof \Countable) {
144 throw new \InvalidArgumentException(
'Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
149 throw new \LogicException(
'A hidden question cannot use the autocompleter.');
152 $this->autocompleterValues = $values;
195 throw new \InvalidArgumentException(
'Maximum number of attempts must be a positive value.');
245 return (
bool) count(array_filter(array_keys($array),
'is_string'));