Yaffs site version 1.1
[yaffs-website] / vendor / psy / psysh / src / Psy / CodeCleaner / FinalClassPass.php
index 57f7ab72d0ed56e27a28208feffe0e8ed22d10c9..c509bef50b0a073b22fdc1f87c0e73eea431b07f 100644 (file)
@@ -12,7 +12,7 @@
 namespace Psy\CodeCleaner;
 
 use PhpParser\Node;
-use PhpParser\Node\Stmt\Class_ as ClassStmt;
+use PhpParser\Node\Stmt\Class_;
 use Psy\Exception\FatalErrorException;
 
 /**
@@ -37,12 +37,12 @@ class FinalClassPass extends CodeCleanerPass
      */
     public function enterNode(Node $node)
     {
-        if ($node instanceof ClassStmt) {
+        if ($node instanceof Class_) {
             if ($node->extends) {
                 $extends = (string) $node->extends;
                 if ($this->isFinalClass($extends)) {
                     $msg = sprintf('Class %s may not inherit from final class (%s)', $node->name, $extends);
-                    throw new FatalErrorException($msg);
+                    throw new FatalErrorException($msg, 0, E_ERROR, null, $node->getLine());
                 }
             }