From b7b08c4396dd03fe73dc4569d977aae86eb1e9b5 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 17 Apr 2024 09:30:28 +0000 Subject: [PATCH] Updated Rector to commit 7574abd469cbfe569dd47dd9ae9e6aa668a0cf1b https://github.com/rectorphp/rector-src/commit/7574abd469cbfe569dd47dd9ae9e6aa668a0cf1b [Php81] Skip mixed type on ArrayDimFetch on NullToStrictStringFuncCallArgRector (#5826) --- .../Rector/FuncCall/NullToStrictStringFuncCallArgRector.php | 4 ++++ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php b/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php index 6c904fa5e8e..ed5a62e9f36 100644 --- a/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php +++ b/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php @@ -6,6 +6,7 @@ namespace Rector\Php81\Rector\FuncCall; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr; +use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\Cast\String_ as CastString_; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\FuncCall; @@ -185,6 +186,9 @@ CODE_SAMPLE if ($this->shouldSkipTrait($argValue, $type, $isTrait)) { return null; } + if ($type instanceof MixedType && $args[$position]->value instanceof ArrayDimFetch) { + return null; + } $args[$position]->value = new CastString_($argValue); $funcCall->args = $args; return $funcCall; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index af24b9745f0..529082d84d3 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 = '18f482fad0993dbf0b55c628557297610256d87d'; + public const PACKAGE_VERSION = '7574abd469cbfe569dd47dd9ae9e6aa668a0cf1b'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-04-17 09:13:11'; + public const RELEASE_DATE = '2024-04-17 16:27:51'; /** * @var int */