diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 31bb7c363ea..e1f158a2c28 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 = '8a49d9de4b568e4d074d1785acc31db8f085c72b'; + public const PACKAGE_VERSION = 'df255c0db4dbfce78ad3fc5bbdb9997490c2ec6d'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-12-20 21:02:21'; + public const RELEASE_DATE = '2024-12-20 14:23:58'; /** * @var int */ diff --git a/src/NodeTypeResolver/PHPStan/Scope/NodeVisitor/ByRefReturnNodeVisitor.php b/src/NodeTypeResolver/PHPStan/Scope/NodeVisitor/ByRefReturnNodeVisitor.php index 69e69ecd0b4..e47fdfc074e 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/NodeVisitor/ByRefReturnNodeVisitor.php +++ b/src/NodeTypeResolver/PHPStan/Scope/NodeVisitor/ByRefReturnNodeVisitor.php @@ -7,6 +7,7 @@ use PhpParser\Node; use PhpParser\Node\FunctionLike; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Return_; +use PhpParser\Node\Stmt\Switch_; use PhpParser\NodeVisitorAbstract; use Rector\Contract\PhpParser\Node\StmtsAwareInterface; use Rector\NodeTypeResolver\Node\AttributeKey; @@ -41,6 +42,12 @@ final class ByRefReturnNodeVisitor extends NodeVisitorAbstract implements ScopeR $this->setByRefAttribute($stmt->stmts); continue; } + if ($stmt instanceof Switch_) { + foreach ($stmt->cases as $case) { + $this->setByRefAttribute($case->stmts); + } + continue; + } if ($stmt instanceof Return_) { $stmt->setAttribute(AttributeKey::IS_BYREF_RETURN, \true); }