diff vendor/psy/psysh/src/Command/TimeitCommand.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/Command/TimeitCommand.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/psy/psysh/src/Command/TimeitCommand.php	Thu Feb 28 13:21:36 2019 +0000
@@ -16,7 +16,6 @@
 use Psy\Command\TimeitCommand\TimeitVisitor;
 use Psy\Input\CodeArgument;
 use Psy\ParserFactory;
-use Psy\Shell;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -99,13 +98,13 @@
         self::$times = [];
 
         if ($num === 1) {
-            $output->writeln(sprintf(self::RESULT_MSG, $times[0]));
+            $output->writeln(\sprintf(self::RESULT_MSG, $times[0]));
         } else {
-            $total = array_sum($times);
-            rsort($times);
-            $median = $times[round($num / 2)];
+            $total = \array_sum($times);
+            \rsort($times);
+            $median = $times[\round($num / 2)];
 
-            $output->writeln(sprintf(self::AVG_RESULT_MSG, $total / $num, $median, $total));
+            $output->writeln(\sprintf(self::AVG_RESULT_MSG, $total / $num, $median, $total));
         }
     }
 
@@ -118,7 +117,7 @@
      */
     public static function markStart()
     {
-        self::$start = microtime(true);
+        self::$start = \microtime(true);
     }
 
     /**
@@ -137,7 +136,7 @@
      */
     public static function markEnd($ret = null)
     {
-        self::$times[] = microtime(true) - self::$start;
+        self::$times[] = \microtime(true) - self::$start;
         self::$start = null;
 
         return $ret;
@@ -185,7 +184,7 @@
         try {
             return $this->parser->parse($code);
         } catch (\PhpParser\Error $e) {
-            if (strpos($e->getMessage(), 'unexpected EOF') === false) {
+            if (\strpos($e->getMessage(), 'unexpected EOF') === false) {
                 throw $e;
             }