Mercurial > hg > isophonics-drupal-site
diff vendor/psy/psysh/src/Command/ShowCommand.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 5fb285c0d0e3 |
children |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/Command/ShowCommand.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/psy/psysh/src/Command/ShowCommand.php Thu Feb 28 13:21:36 2019 +0000 @@ -140,16 +140,16 @@ $index = 0; } } else { - $index = max(0, intval($input->getOption('ex')) - 1); + $index = \max(0, \intval($input->getOption('ex')) - 1); } $trace = $exception->getTrace(); - array_unshift($trace, [ + \array_unshift($trace, [ 'file' => $exception->getFile(), 'line' => $exception->getLine(), ]); - if ($index >= count($trace)) { + if ($index >= \count($trace)) { $index = 0; } @@ -169,25 +169,25 @@ $file = isset($trace[$index]['file']) ? $this->replaceCwd($trace[$index]['file']) : 'n/a'; $line = isset($trace[$index]['line']) ? $trace[$index]['line'] : 'n/a'; - $output->writeln(sprintf( + $output->writeln(\sprintf( 'From <info>%s:%d</info> at <strong>level %d</strong> of backtrace (of %d).', OutputFormatter::escape($file), OutputFormatter::escape($line), $index + 1, - count($trace) + \count($trace) )); } private function replaceCwd($file) { - if ($cwd = getcwd()) { - $cwd = rtrim($cwd, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; + if ($cwd = \getcwd()) { + $cwd = \rtrim($cwd, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; } if ($cwd === false) { return $file; } else { - return preg_replace('/^' . preg_quote($cwd, '/') . '/', '', $file); + return \preg_replace('/^' . \preg_quote($cwd, '/') . '/', '', $file); } } @@ -208,8 +208,8 @@ $line = $trace[$index]['line']; } - if (is_file($file)) { - $code = @file_get_contents($file); + if (\is_file($file)) { + $code = @\file_get_contents($file); } if (empty($code)) { @@ -268,12 +268,12 @@ $line = $context['line']; } - if (is_file($file)) { + if (\is_file($file)) { $vars['__file'] = $file; if (isset($line)) { $vars['__line'] = $line; } - $vars['__dir'] = dirname($file); + $vars['__dir'] = \dirname($file); } } @@ -282,7 +282,7 @@ private function extractEvalFileAndLine($file) { - if (preg_match('/(.*)\\((\\d+)\\) : eval\\(\\)\'d code$/', $file, $matches)) { + if (\preg_match('/(.*)\\((\\d+)\\) : eval\\(\\)\'d code$/', $file, $matches)) { return [$matches[1], $matches[2]]; } }