Aggiornato Composer
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* This file is part of Psy Shell.
|
||||
*
|
||||
* (c) 2012-2022 Justin Hileman
|
||||
* (c) 2012-2023 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -24,6 +24,8 @@ class FinalClassPass extends CodeCleanerPass
|
||||
|
||||
/**
|
||||
* @param array $nodes
|
||||
*
|
||||
* @return Node[]|null Array of nodes
|
||||
*/
|
||||
public function beforeTraverse(array $nodes)
|
||||
{
|
||||
@@ -34,6 +36,8 @@ class FinalClassPass extends CodeCleanerPass
|
||||
* @throws FatalErrorException if the node is a class that extends a final class
|
||||
*
|
||||
* @param Node $node
|
||||
*
|
||||
* @return int|Node|null Replacement node (or special return value)
|
||||
*/
|
||||
public function enterNode(Node $node)
|
||||
{
|
||||
@@ -42,7 +46,7 @@ class FinalClassPass extends CodeCleanerPass
|
||||
$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, 0, \E_ERROR, null, $node->getLine());
|
||||
throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getStartLine());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +58,6 @@ class FinalClassPass extends CodeCleanerPass
|
||||
|
||||
/**
|
||||
* @param string $name Class name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isFinalClass(string $name): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user