Yaffs site version 1.1
[yaffs-website] / vendor / psy / psysh / src / Psy / CodeCleaner / CallTimePassByReferencePass.php
index 19f85349f9dd61ccea4b7c537b57532c4fb5951e..5a5eeba129836df2bc501c8a3e54293d8b82fdb2 100644 (file)
@@ -12,7 +12,7 @@
 namespace Psy\CodeCleaner;
 
 use PhpParser\Node;
-use PhpParser\Node\Expr\FuncCall as FunctionCall;
+use PhpParser\Node\Expr\FuncCall;
 use PhpParser\Node\Expr\MethodCall;
 use PhpParser\Node\Expr\StaticCall;
 use Psy\Exception\FatalErrorException;
@@ -26,6 +26,8 @@ use Psy\Exception\FatalErrorException;
  */
 class CallTimePassByReferencePass extends CodeCleanerPass
 {
+    const EXCEPTION_MESSAGE = 'Call-time pass-by-reference has been removed';
+
     /**
      * Validate of use call-time pass-by-reference.
      *
@@ -39,13 +41,13 @@ class CallTimePassByReferencePass extends CodeCleanerPass
             return;
         }
 
-        if (!$node instanceof FunctionCall && !$node instanceof MethodCall && !$node instanceof StaticCall) {
+        if (!$node instanceof FuncCall && !$node instanceof MethodCall && !$node instanceof StaticCall) {
             return;
         }
 
         foreach ($node->args as $arg) {
             if ($arg->byRef) {
-                throw new FatalErrorException('Call-time pass-by-reference has been removed');
+                throw new FatalErrorException(self::EXCEPTION_MESSAGE, 0, E_ERROR, null, $node->getLine());
             }
         }
     }