Updated Rector to commit a4445df500e51deb893319e180c3fbdf64e8dc25

a4445df500 Cleanup scope check on UnreachableStatementNodeVisitor (#5648)
This commit is contained in:
Tomas Votruba 2024-02-21 08:05:42 +00:00
parent c6cecac9f8
commit 194c0359f1
2 changed files with 5 additions and 4 deletions

View File

@ -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
*/

View File

@ -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;