original_string: public function setAutocompleterValues($values)
      {
          if (\is_array($values)) {
              $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
  
              $callback = static function () use ($values) {
                  return $values;
              };
          } elseif ($values instanceof \Traversable) {
              $valueCache = null;
              $callback = static function () use ($values, &$valueCache) {
                  return $valueCache ?? $valueCache = iterator_to_array($values, false);
              };
          } elseif (null === $values) {
              $callback = null;
          } else {
              throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
          }
  
          return $this->setAutocompleterCallback($callback);
      }
code: public function setAutocompleterValues($values)
      {
          if (\is_array($values)) {
              $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
  
              $callback = static function () use ($values) {
                  return $values;
              };
          } elseif ($values instanceof \Traversable) {
              $valueCache = null;
              $callback = static function () use ($values, &$valueCache) {
                  return $valueCache ?? $valueCache = iterator_to_array($values, false);
              };
          } elseif (null === $values) {
              $callback = null;
          } else {
              throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
          }
  
          return $this->setAutocompleterCallback($callback);
      }
code_tokens: public function setAutocompleterValues ( $ values ) { if ( \ is_array ( $ values ) ) { $ values = $ this -> isAssoc ( $ values ) ? array_merge ( array_keys ( $ values ) , array_values ( $ values ) ) : array_values ( $ values ) ; $ callback = static function ( ) use ( $ values ) { return $ values ; } ; } elseif ( $ values instanceof \ Traversable ) { $ valueCache = null ; $ callback = static function ( ) use ( $ values , & $ valueCache ) { return $ valueCache ?? $ valueCache = iterator_to_array ( $ values , false ) ; } ; } elseif ( null === $ values ) { $ callback = null ; } else { throw new InvalidArgumentException ( 'Autocompleter values can be either an array, "null" or a "Traversable" object.' ) ; } return $ this -> setAutocompleterCallback ( $ callback ) ; }
docstring: Sets values for the autocompleter.
  
  @param iterable|null $values
  
  @return $this
  
  @throws InvalidArgumentException
  @throws LogicException
docstring_tokens: Sets values for the autocompleter .