From 9e205fbc3e4c77581ec5a7ff975867e1dfc50b66 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 20 Oct 2024 00:34:29 +0000 Subject: [PATCH] Updated Rector to commit 23917974669d13ac0632cf53f6c85c7f74e98a6b https://github.com/rectorphp/rector-src/commit/23917974669d13ac0632cf53f6c85c7f74e98a6b [CodeQuality] Skip append non empty array on ForeachItemsAssignToEmptyArrayToAssignRector (#6390) --- .../Foreach_/ForeachItemsAssignToEmptyArrayToAssignRector.php | 4 ++++ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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 */