From ec5fc97f725b280b0eb99c7cefdba3b5cc210e9c Mon Sep 17 00:00:00 2001 From: "v.razuvaev" Date: Tue, 10 Nov 2026 22:01:33 +0100 Subject: [PATCH 1/2] Raise vimeo/psalm to ^7.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5386520..a9a6a2a 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "roave/backward-compatibility-check": "^8.0", "testo/bridge-infection": "^0.1.6", "testo/testo": "^0.10.25", - "vimeo/psalm": "^6.16" + "vimeo/psalm": "^7.0" }, "autoload": { "psr-4": { From b7d277e029fa84d29a1a0e637b6ad43a838f4e1f Mon Sep 17 00:00:00 2001 From: "v.razuvaev" Date: Tue, 10 Nov 2026 22:21:41 +0100 Subject: [PATCH 2/2] Filter array holes instead of a null check Psalm 7 deems redundant PhpParser stubs in Psalm 7 type Array_::items as ArrayItem without null, so $item !== null is RedundantCondition. array_filter() keeps the runtime guard for list holes ([1, , 3]) without the flagged check. --- src/LostDateTimeMutationRector.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/LostDateTimeMutationRector.php b/src/LostDateTimeMutationRector.php index d295419..89fb2f7 100644 --- a/src/LostDateTimeMutationRector.php +++ b/src/LostDateTimeMutationRector.php @@ -396,10 +396,8 @@ private function forgetAssignedVariables(?Expr $expr, Node $context): void return; } - foreach ($expr->items as $item) { - if ($item !== null) { - $this->forgetAssignedVariables($item->value, $context); - } + foreach (array_filter($expr->items) as $item) { + $this->forgetAssignedVariables($item->value, $context); } }