mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit e231caaf0ad81f75b287fb7b2b47f720627a7ca4
e231caaf0a
[Performance] Remove loop StmtsAwareInterface on PHPStanNodeScopeResolver (#5450)
This commit is contained in:
parent
ca876bf90c
commit
5a61fded6a
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '9193b276de2d9e51e063740a9fea61a559750f19';
|
||||
public const PACKAGE_VERSION = 'e231caaf0ad81f75b287fb7b2b47f720627a7ca4';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-10 12:52:57';
|
||||
public const RELEASE_DATE = '2024-01-10 16:43:21';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -51,7 +51,6 @@ use PHPStan\Node\UnreachableStatementNode;
|
|||
use PHPStan\Reflection\ReflectionProvider;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Type\TypeCombinator;
|
||||
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
|
||||
use Rector\Exception\ShouldNotHappenException;
|
||||
use Rector\NodeAnalyzer\ClassAnalyzer;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
|
@ -147,11 +146,6 @@ final class PHPStanNodeScopeResolver
|
|||
$this->nodeScopeResolver->processNodes($node->stmts, $mutatingScope, $nodeCallback);
|
||||
return;
|
||||
}
|
||||
if ($node instanceof StmtsAwareInterface && $node->stmts !== null) {
|
||||
foreach ($node->stmts as $stmt) {
|
||||
$stmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
}
|
||||
}
|
||||
if (($node instanceof Expression || $node instanceof Return_ || $node instanceof EnumCase || $node instanceof Cast) && $node->expr instanceof Expr) {
|
||||
$node->expr->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
} elseif ($node instanceof Assign || $node instanceof AssignOp) {
|
||||
|
|
|
@ -67,7 +67,7 @@ final class RectifiedAnalyzer
|
|||
return \true;
|
||||
}
|
||||
if ($node instanceof Stmt) {
|
||||
return \array_keys($node->getAttributes()) === [AttributeKey::STMT_KEY];
|
||||
return !\in_array(AttributeKey::SCOPE, \array_keys($node->getAttributes()), \true);
|
||||
}
|
||||
return $node->getAttributes() === [];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue