diff --git a/rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php b/rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php index 9d5b1fdd0e8..8f93d62a4ad 100644 --- a/rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php +++ b/rules/DeadCode/Rector/Node/RemoveNonExistingVarAnnotationRector.php @@ -147,6 +147,9 @@ public function refactor(Node $node) : ?Node // skip edge case with double comment, as impossible to resolve by PHPStan doc parser continue; } + if ($this->stmtsManipulator->isVariableUsedInNextStmt($node, $key + 1, $variableName)) { + continue; + } $phpDocInfo->removeByType(VarTagValueNode::class); $this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($stmt); $hasChanged = \true; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index a53e311fbd3..df3b96a6e4b 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'b88e910957a85adafd6fb75fbe50991b9ec871d1'; + public const PACKAGE_VERSION = 'c0c7502f55a3884f67a5885ed05ae2443ff53802'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-02 16:56:58'; + public const RELEASE_DATE = '2024-10-03 10:18:39'; /** * @var int */