Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / psy / psysh / src / Command / ShowCommand.php
index cae86e59c73987cf8e2b5da10148ce19dff24328..47d1865486b006c20bab4a9f0ed204d9e7767d1a 100644 (file)
@@ -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 <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 @@ 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]];
         }
     }