mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-29 11:33:33 +01:00
Updated Rector to commit a4445df500e51deb893319e180c3fbdf64e8dc25
a4445df500
Cleanup scope check on UnreachableStatementNodeVisitor (#5648)
This commit is contained in:
parent
c6cecac9f8
commit
194c0359f1
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '3b44873d14db5c15a33147bc6aa395e95ec17def';
|
||||
public const PACKAGE_VERSION = 'a4445df500e51deb893319e180c3fbdf64e8dc25';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-02-21 14:45:26';
|
||||
public const RELEASE_DATE = '2024-02-21 15:03:30';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -47,7 +47,9 @@ final class UnreachableStatementNodeVisitor extends NodeVisitorAbstract
|
||||
$isPassedUnreachableStmt = \false;
|
||||
$mutatingScope = $this->resolveScope($node->getAttribute(AttributeKey::SCOPE));
|
||||
foreach ($node->stmts as $stmt) {
|
||||
if (!$stmt->getAttribute(AttributeKey::SCOPE) instanceof MutatingScope) {
|
||||
$hasMutatingScope = $stmt->getAttribute(AttributeKey::SCOPE) instanceof MutatingScope;
|
||||
if (!$hasMutatingScope) {
|
||||
$stmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
$this->phpStanNodeScopeResolver->processNodes([$stmt], $this->filePath, $mutatingScope);
|
||||
}
|
||||
if ($stmt->getAttribute(AttributeKey::IS_UNREACHABLE) === \true) {
|
||||
@ -56,7 +58,6 @@ final class UnreachableStatementNodeVisitor extends NodeVisitorAbstract
|
||||
}
|
||||
if ($isPassedUnreachableStmt) {
|
||||
$stmt->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
|
||||
$stmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user