X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FCommand%2FShowCommand.php;h=47d1865486b006c20bab4a9f0ed204d9e7767d1a;hp=cae86e59c73987cf8e2b5da10148ce19dff24328;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c
diff --git a/vendor/psy/psysh/src/Command/ShowCommand.php b/vendor/psy/psysh/src/Command/ShowCommand.php
index cae86e59c..47d186548 100644
--- a/vendor/psy/psysh/src/Command/ShowCommand.php
+++ b/vendor/psy/psysh/src/Command/ShowCommand.php
@@ -140,16 +140,16 @@ HELP
$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 @@ HELP
$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 %s:%d at level %d 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 @@ HELP
$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 @@ HELP
$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 @@ HELP
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]];
}
}