public function processCallback($input, $index, $info = [])
    {
        // Some (Windows?) systems provide incomplete `readline_info`, so let's
        // try to work around it.
        $line = $info['line_buffer'];
        if (isset($info['end'])) {
            $line = \substr($line, 0, $info['end']);
        }
        if ($line === '' && $input !== '') {
            $line = $input;
        }

        $tokens = \token_get_all('<?php ' . $line);

        // remove whitespaces
        $tokens = \array_filter($tokens, function ($token) {
            return !AbstractMatcher::tokenIs($token, AbstractMatcher::T_WHITESPACE);
        });

        $matches = [];
        foreach ($this->matchers as $matcher) {
            if ($matcher->hasMatched($tokens)) {
                $matches = \array_merge($matcher->getMatches($tokens), $matches);
            }
        }

        $matches = \array_unique($matches);

        return !empty($matches) ? $matches : [''];
    }
public function processCallback($input, $index, $info = [])
    {
        // Some (Windows?) systems provide incomplete `readline_info`, so let's
        // try to work around it.
        $line = $info['line_buffer'];
        if (isset($info['end'])) {
            $line = \substr($line, 0, $info['end']);
        }
        if ($line === '' && $input !== '') {
            $line = $input;
        }

        $tokens = \token_get_all('<?php ' . $line);

        // remove whitespaces
        $tokens = \array_filter($tokens, function ($token) {
            return !AbstractMatcher::tokenIs($token, AbstractMatcher::T_WHITESPACE);
        });

        $matches = [];
        foreach ($this->matchers as $matcher) {
            if ($matcher->hasMatched($tokens)) {
                $matches = \array_merge($matcher->getMatches($tokens), $matches);
            }
        }

        $matches = \array_unique($matches);

        return !empty($matches) ? $matches : [''];
    }
public function processCallback ( $ input , $ index , $ info = [ ] ) { // Some (Windows?) systems provide incomplete `readline_info`, so let's // try to work around it. $ line = $ info [ 'line_buffer' ] ; if ( isset ( $ info [ 'end' ] ) ) { $ line = \ substr ( $ line , 0 , $ info [ 'end' ] ) ; } if ( $ line === '' && $ input !== '' ) { $ line = $ input ; } $ tokens = \ token_get_all ( '<?php ' . $ line ) ; // remove whitespaces $ tokens = \ array_filter ( $ tokens , function ( $ token ) { return ! AbstractMatcher :: tokenIs ( $ token , AbstractMatcher :: T_WHITESPACE ) ; } ) ; $ matches = [ ] ; foreach ( $ this -> matchers as $ matcher ) { if ( $ matcher -> hasMatched ( $ tokens ) ) { $ matches = \ array_merge ( $ matcher -> getMatches ( $ tokens ) , $ matches ) ; } } $ matches = \ array_unique ( $ matches ) ; return ! empty ( $ matches ) ? $ matches : [ '' ] ; }
Handle readline completion.

@param string $input Readline current word
@param int    $index Current word index
@param array  $info  readline_info() data

@return array
Handle readline completion .