namespace Psy\CodeCleaner;
use PhpParser\Node;
-use PhpParser\Node\Stmt\Class_ as ClassStmt;
+use PhpParser\Node\Stmt\Class_;
use Psy\Exception\FatalErrorException;
/**
*/
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());
}
}