Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / psy / psysh / src / CodeCleaner / FunctionReturnInWriteContextPass.php
similarity index 88%
rename from vendor/psy/psysh/src/Psy/CodeCleaner/FunctionReturnInWriteContextPass.php
rename to vendor/psy/psysh/src/CodeCleaner/FunctionReturnInWriteContextPass.php
index 42aae5ec9ba70832371d6412606e5d8af8193dbe..e883a807bc13e07d6fee105688f859a3f764509a 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.
@@ -32,11 +32,11 @@ class FunctionReturnInWriteContextPass extends CodeCleanerPass
     const PHP55_MESSAGE = 'Cannot use isset() on the result of a function call (you can use "null !== func()" instead)';
     const EXCEPTION_MESSAGE = "Can't use function return value in write context";
 
-    private $isPhp55;
+    private $atLeastPhp55;
 
     public function __construct()
     {
-        $this->isPhp55 = version_compare(PHP_VERSION, '5.5', '>=');
+        $this->atLeastPhp55 = version_compare(PHP_VERSION, '5.5', '>=');
     }
 
     /**
@@ -64,10 +64,10 @@ class FunctionReturnInWriteContextPass extends CodeCleanerPass
                     continue;
                 }
 
-                $msg = ($node instanceof Isset_ && $this->isPhp55) ? self::PHP55_MESSAGE : self::EXCEPTION_MESSAGE;
+                $msg = ($node instanceof Isset_ && $this->atLeastPhp55) ? self::PHP55_MESSAGE : self::EXCEPTION_MESSAGE;
                 throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
             }
-        } elseif ($node instanceof Empty_ && !$this->isPhp55 && $this->isCallNode($node->expr)) {
+        } elseif ($node instanceof Empty_ && !$this->atLeastPhp55 && $this->isCallNode($node->expr)) {
             throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, E_ERROR, null, $node->getLine());
         } elseif ($node instanceof Assign && $this->isCallNode($node->var)) {
             throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, E_ERROR, null, $node->getLine());