X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FReadline%2FGNUReadline.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FReadline%2FGNUReadline.php;h=1cec3c63a0404a40089894353b8a6c8d0c829616;hp=e10412208e0ae4625f2a8c29501b1517377bcb74;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/psy/psysh/src/Readline/GNUReadline.php b/vendor/psy/psysh/src/Readline/GNUReadline.php index e10412208..1cec3c63a 100644 --- a/vendor/psy/psysh/src/Readline/GNUReadline.php +++ b/vendor/psy/psysh/src/Readline/GNUReadline.php @@ -36,7 +36,7 @@ class GNUReadline implements Readline */ public static function isSupported() { - return function_exists('readline_list_history'); + return \function_exists('readline_list_history'); } /** @@ -58,7 +58,7 @@ class GNUReadline implements Readline */ public function addHistory($line) { - if ($res = readline_add_history($line)) { + if ($res = \readline_add_history($line)) { $this->writeHistory(); } @@ -70,7 +70,7 @@ class GNUReadline implements Readline */ public function clearHistory() { - if ($res = readline_clear_history()) { + if ($res = \readline_clear_history()) { $this->writeHistory(); } @@ -96,12 +96,12 @@ class GNUReadline implements Readline // // https://github.com/php/php-src/blob/423a057023ef3c00d2ffc16a6b43ba01d0f71796/NEWS#L19-L21 // - if (version_compare(PHP_VERSION, '5.6.7', '>=') || !ini_get('open_basedir')) { - readline_read_history(); + if (\version_compare(PHP_VERSION, '5.6.7', '>=') || !\ini_get('open_basedir')) { + \readline_read_history(); } - readline_clear_history(); + \readline_clear_history(); - return readline_read_history($this->historyFile); + return \readline_read_history($this->historyFile); } /** @@ -109,7 +109,7 @@ class GNUReadline implements Readline */ public function readline($prompt = null) { - return readline($prompt); + return \readline($prompt); } /** @@ -117,7 +117,7 @@ class GNUReadline implements Readline */ public function redisplay() { - readline_redisplay(); + \readline_redisplay(); } /** @@ -128,7 +128,7 @@ class GNUReadline implements Readline // We have to write history first, since it is used // by Libedit to list history if ($this->historyFile !== false) { - $res = readline_write_history($this->historyFile); + $res = \readline_write_history($this->historyFile); } else { $res = true; } @@ -144,25 +144,25 @@ class GNUReadline implements Readline if ($this->eraseDups) { // flip-flip technique: removes duplicates, latest entries win. - $hist = array_flip(array_flip($hist)); + $hist = \array_flip(\array_flip($hist)); // sort on keys to get the order back - ksort($hist); + \ksort($hist); } if ($this->historySize > 0) { - $histsize = count($hist); + $histsize = \count($hist); if ($histsize > $this->historySize) { - $hist = array_slice($hist, $histsize - $this->historySize); + $hist = \array_slice($hist, $histsize - $this->historySize); } } - readline_clear_history(); + \readline_clear_history(); foreach ($hist as $line) { - readline_add_history($line); + \readline_add_history($line); } if ($this->historyFile !== false) { - return readline_write_history($this->historyFile); + return \readline_write_history($this->historyFile); } return true;