Mercurial > hg > isophonics-drupal-site
diff vendor/psy/psysh/src/CodeCleaner.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/CodeCleaner.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/psy/psysh/src/CodeCleaner.php Thu Feb 28 13:21:36 2019 +0000 @@ -138,7 +138,7 @@ } try { - $code = @file_get_contents($file); + $code = @\file_get_contents($file); if (!$code) { return; } @@ -169,15 +169,15 @@ */ private static function getDebugFile() { - $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $trace = \debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - foreach (array_reverse($trace) as $stackFrame) { + foreach (\array_reverse($trace) as $stackFrame) { if (!self::isDebugCall($stackFrame)) { continue; } - if (preg_match('/eval\(/', $stackFrame['file'])) { - preg_match_all('/([^\(]+)\((\d+)/', $stackFrame['file'], $matches); + if (\preg_match('/eval\(/', $stackFrame['file'])) { + \preg_match_all('/([^\(]+)\((\d+)/', $stackFrame['file'], $matches); return $matches[1][0]; } @@ -214,7 +214,7 @@ */ public function clean(array $codeLines, $requireSemicolons = false) { - $stmts = $this->parse('<?php ' . implode(PHP_EOL, $codeLines) . PHP_EOL, $requireSemicolons); + $stmts = $this->parse('<?php ' . \implode(PHP_EOL, $codeLines) . PHP_EOL, $requireSemicolons); if ($stmts === false) { return false; } @@ -223,13 +223,13 @@ $stmts = $this->traverser->traverse($stmts); // Work around https://github.com/nikic/PHP-Parser/issues/399 - $oldLocale = setlocale(LC_NUMERIC, 0); - setlocale(LC_NUMERIC, 'C'); + $oldLocale = \setlocale(LC_NUMERIC, 0); + \setlocale(LC_NUMERIC, 'C'); $code = $this->printer->prettyPrint($stmts); // Now put the locale back - setlocale(LC_NUMERIC, $oldLocale); + \setlocale(LC_NUMERIC, $oldLocale); return $code; } @@ -307,7 +307,7 @@ { $msg = $e->getRawMessage(); - return ($msg === 'Unexpected token EOF') || (strpos($msg, 'Syntax error, unexpected EOF') !== false); + return ($msg === 'Unexpected token EOF') || (\strpos($msg, 'Syntax error, unexpected EOF') !== false); } /** @@ -344,6 +344,6 @@ private function parseErrorIsTrailingComma(\PhpParser\Error $e, $code) { - return ($e->getRawMessage() === 'A trailing comma is not allowed here') && (substr(rtrim($code), -1) === ','); + return ($e->getRawMessage() === 'A trailing comma is not allowed here') && (\substr(\rtrim($code), -1) === ','); } }