Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / psy / psysh / src / CodeCleaner / LoopContextPass.php
similarity index 91%
rename from vendor/psy/psysh/src/Psy/CodeCleaner/LoopContextPass.php
rename to vendor/psy/psysh/src/CodeCleaner/LoopContextPass.php
index e8f65bb9efe893d4a93d883dde5c724dc281d1c5..9744fcb6c23ba293e29a94d82b3c800081a5725c 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * This file is part of Psy Shell.
  *
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
@@ -28,14 +28,8 @@ use Psy\Exception\FatalErrorException;
  */
 class LoopContextPass extends CodeCleanerPass
 {
-    private $isPHP54;
     private $loopDepth;
 
-    public function __construct()
-    {
-        $this->isPHP54 = version_compare(PHP_VERSION, '5.4.0', '>=');
-    }
-
     /**
      * {@inheritdoc}
      */
@@ -74,7 +68,7 @@ class LoopContextPass extends CodeCleanerPass
 
                 if ($node->num instanceof LNumber || $node->num instanceof DNumber) {
                     $num = $node->num->value;
-                    if ($this->isPHP54 && ($node->num instanceof DNumber || $num < 1)) {
+                    if ($node->num instanceof DNumber || $num < 1) {
                         $msg = sprintf("'%s' operator accepts only positive numbers", $operator);
                         throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
                     }
@@ -83,7 +77,7 @@ class LoopContextPass extends CodeCleanerPass
                         $msg = sprintf("Cannot '%s' %d levels", $operator, $num);
                         throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
                     }
-                } elseif ($node->num && $this->isPHP54) {
+                } elseif ($node->num) {
                     $msg = sprintf("'%s' operator with non-constant operand is no longer supported", $operator);
                     throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
                 }