public function setAutocomplete($autocomplete)
    {
        if ($autocomplete !== null && !is_callable($autocomplete)) {
            throw new \InvalidArgumentException('Invalid autocomplete function given');
        }

        $this->autocomplete = $autocomplete;

        return $this;
    }
public function setAutocomplete($autocomplete)
    {
        if ($autocomplete !== null && !is_callable($autocomplete)) {
            throw new \InvalidArgumentException('Invalid autocomplete function given');
        }

        $this->autocomplete = $autocomplete;

        return $this;
    }
public function setAutocomplete ( $ autocomplete ) { if ( $ autocomplete !== null && ! is_callable ( $ autocomplete ) ) { throw new \ InvalidArgumentException ( 'Invalid autocomplete function given' ) ; } $ this -> autocomplete = $ autocomplete ; return $ this ; }
set autocompletion handler to use

The autocomplete handler will be called whenever the user hits the TAB
key.

@param callable|null $autocomplete
@return self
@throws \InvalidArgumentException if the given callable is invalid
set autocompletion handler to use