diff --git a/rules/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php b/rules/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php index edc6cf9523b..e8d8eac7dfd 100644 --- a/rules/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php +++ b/rules/CodeQuality/Rector/Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php @@ -119,6 +119,10 @@ CODE_SAMPLE return NodeTraverser::STOP_TRAVERSAL; } } + if ($subNode instanceof Assign && $subNode->var instanceof Variable && $this->isNames($subNode->var, $emptyArrayVariables) && !$this->valueResolver->isValue($subNode->expr, [])) { + $isAppend = \true; + return NodeTraverser::STOP_TRAVERSAL; + } return null; }); return $isAppend; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0cf80c4c95b..e69ea964f95 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 = '3bd920dc75b8b25cace7af734d127a2bf275881d'; + public const PACKAGE_VERSION = '23917974669d13ac0632cf53f6c85c7f74e98a6b'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-19 14:27:42'; + public const RELEASE_DATE = '2024-10-20 07:32:00'; /** * @var int */