*/
public function activate()
{
- readline_completion_function([&$this, 'callback']);
+ \readline_completion_function([&$this, 'callback']);
}
/**
// try to work around it.
$line = $info['line_buffer'];
if (isset($info['end'])) {
- $line = substr($line, 0, $info['end']);
+ $line = \substr($line, 0, $info['end']);
}
if ($line === '' && $input !== '') {
$line = $input;
}
- $tokens = token_get_all('<?php ' . $line);
+ $tokens = \token_get_all('<?php ' . $line);
// remove whitespaces
- $tokens = array_filter($tokens, function ($token) {
+ $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_merge($matcher->getMatches($tokens), $matches);
}
}
- $matches = array_unique($matches);
+ $matches = \array_unique($matches);
return !empty($matches) ? $matches : [''];
}
*/
public function callback($input, $index)
{
- return $this->processCallback($input, $index, readline_info());
+ return $this->processCallback($input, $index, \readline_info());
}
/**
{
// PHP didn't implement the whole readline API when they first switched
// to libedit. And they still haven't.
- //
- // So this is a thing to make PsySH work on 5.3.x:
- if (function_exists('readline_callback_handler_remove')) {
- readline_callback_handler_remove();
+ if (\function_exists('readline_callback_handler_remove')) {
+ \readline_callback_handler_remove();
}
}
}