From c050377f9617695378c1689785f55aca988bd74d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 6 Aug 2024 13:55:04 +0000 Subject: [PATCH] Updated Rector to commit 69a3e31e443dc9610e675ee2ac380cd8f6581a4c https://github.com/rectorphp/rector-src/commit/69a3e31e443dc9610e675ee2ac380cd8f6581a4c [CodeQuality] Skip Generator on SimplifyForeachToCoalescingRector (#6221) --- .../Rector/Foreach_/SimplifyForeachToCoalescingRector.php | 4 ++++ src/Application/VersionResolver.php | 4 ++-- vendor/scoper-autoload.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rules/CodeQuality/Rector/Foreach_/SimplifyForeachToCoalescingRector.php b/rules/CodeQuality/Rector/Foreach_/SimplifyForeachToCoalescingRector.php index 6e2c11113bf..55d62e4527c 100644 --- a/rules/CodeQuality/Rector/Foreach_/SimplifyForeachToCoalescingRector.php +++ b/rules/CodeQuality/Rector/Foreach_/SimplifyForeachToCoalescingRector.php @@ -131,6 +131,10 @@ private function matchForeachReturnOrAssign(Foreach_ $foreach) if ($if->else instanceof Else_ || $if->elseifs !== []) { return null; } + $foreachExprType = $this->nodeTypeResolver->getNativeType($foreach->expr); + if (!$foreachExprType->isArray()->yes()) { + return null; + } $innerStmt = $if->stmts[0]; if ($innerStmt instanceof Return_) { return $innerStmt; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 12762e7f514..2c0654a6e08 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 = '6a4d7178cc23656fabc4ea31a8d1673cdfde6e37'; + public const PACKAGE_VERSION = '69a3e31e443dc9610e675ee2ac380cd8f6581a4c'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-08-06 20:26:09'; + public const RELEASE_DATE = '2024-08-06 20:52:34'; /** * @var int */ diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index f081d8cf7ac..562e1c4af98 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -14,7 +14,7 @@ // Restore the backup and ensure the excluded files are properly marked as loaded $GLOBALS['__composer_autoload_files'] = \array_merge( $existingComposerAutoloadFiles, - \array_fill_keys(['0e6d7bf4a5811bfa5cf40c5ccd6fae6a', '5928a00fa978807cf85d90ec3f4b0147'], true) + \array_fill_keys(['5928a00fa978807cf85d90ec3f4b0147', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a'], true) ); return $loader;