Mercurial > hg > cmmr2012-drupal-site
diff vendor/psy/psysh/src/Readline/Transient.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/Readline/Transient.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/psy/psysh/src/Readline/Transient.php Thu Feb 28 13:11:55 2019 +0000 @@ -50,7 +50,7 @@ public function addHistory($line) { if ($this->eraseDups) { - if (($key = array_search($line, $this->history)) !== false) { + if (($key = \array_search($line, $this->history)) !== false) { unset($this->history[$key]); } } @@ -58,13 +58,13 @@ $this->history[] = $line; if ($this->historySize > 0) { - $histsize = count($this->history); + $histsize = \count($this->history); if ($histsize > $this->historySize) { - $this->history = array_slice($this->history, $histsize - $this->historySize); + $this->history = \array_slice($this->history, $histsize - $this->historySize); } } - $this->history = array_values($this->history); + $this->history = \array_values($this->history); return true; } @@ -106,7 +106,7 @@ { echo $prompt; - return rtrim(fgets($this->getStdin(), 1024)); + return \rtrim(\fgets($this->getStdin()), "\n\r"); } /** @@ -135,10 +135,10 @@ private function getStdin() { if (!isset($this->stdin)) { - $this->stdin = fopen('php://stdin', 'r'); + $this->stdin = \fopen('php://stdin', 'r'); } - if (feof($this->stdin)) { + if (\feof($this->stdin)) { throw new BreakException('Ctrl+D'); }