X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FCodeCleaner%2FCallTimePassByReferencePass.php;h=5a5eeba129836df2bc501c8a3e54293d8b82fdb2;hp=19f85349f9dd61ccea4b7c537b57532c4fb5951e;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/psy/psysh/src/Psy/CodeCleaner/CallTimePassByReferencePass.php b/vendor/psy/psysh/src/Psy/CodeCleaner/CallTimePassByReferencePass.php index 19f85349f..5a5eeba12 100644 --- a/vendor/psy/psysh/src/Psy/CodeCleaner/CallTimePassByReferencePass.php +++ b/vendor/psy/psysh/src/Psy/CodeCleaner/CallTimePassByReferencePass.php @@ -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()); } } }