think\console\output\Question::setAutocompleterValues PHP Method

setAutocompleterValues() public method

设置自动完成的值
public setAutocompleterValues ( null | array | Traversable $values ) : Question
$values null | array | Traversable
return Question
    public function setAutocompleterValues($values)
    {
        if (is_array($values) && $this->isAssoc($values)) {
            $values = array_merge(array_keys($values), array_values($values));
        }
        if (null !== $values && !is_array($values)) {
            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.');
            }
        }
        if ($this->hidden) {
            throw new \LogicException('A hidden question cannot use the autocompleter.');
        }
        $this->autocompleterValues = $values;
        return $this;
    }