From 1eb3a7a3a9a4608bb1eeb775d444660cb82515d2 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 8 Oct 2023 03:17:49 +0000 Subject: [PATCH] Updated Rector to commit 4d56a61025597b598a1287f76f475bb6e8f1766f https://github.com/rectorphp/rector-src/commit/4d56a61025597b598a1287f76f475bb6e8f1766f [DeadCode] Remove UnionType check on RecastingRemovalRector (#5142) --- rules/DeadCode/Rector/Cast/RecastingRemovalRector.php | 7 +------ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/rules/DeadCode/Rector/Cast/RecastingRemovalRector.php b/rules/DeadCode/Rector/Cast/RecastingRemovalRector.php index 6a33baed112..246b0c28b13 100644 --- a/rules/DeadCode/Rector/Cast/RecastingRemovalRector.php +++ b/rules/DeadCode/Rector/Cast/RecastingRemovalRector.php @@ -14,7 +14,6 @@ use PhpParser\Node\Expr\Cast\Object_; use PhpParser\Node\Expr\Cast\String_; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\StaticCall; -use PhpParser\Node\Expr\StaticPropertyFetch; use PHPStan\Reflection\Php\PhpPropertyReflection; use PHPStan\Type\ArrayType; use PHPStan\Type\BooleanType; @@ -126,11 +125,7 @@ CODE_SAMPLE } $phpPropertyReflection = $this->reflectionResolver->resolvePropertyReflectionFromPropertyFetch($expr); if (!$phpPropertyReflection instanceof PhpPropertyReflection) { - $propertyType = $expr instanceof StaticPropertyFetch ? $this->nodeTypeResolver->getType($expr->class) : $this->nodeTypeResolver->getType($expr->var); - // need to UnionType check due rectify with RecastingRemovalRector + CountOnNullRector - // cause add (array) cast on $node->args - // on union $node types FuncCall|MethodCall|StaticCall - return !$propertyType instanceof UnionType; + return \true; } $nativeType = $phpPropertyReflection->getNativeType(); return $nativeType instanceof MixedType; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index e60281cc265..b90746712fa 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 = 'e83c7ef0b689c36d548ae0328b4a4bcf6fcde6b8'; + public const PACKAGE_VERSION = '4d56a61025597b598a1287f76f475bb6e8f1766f'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-10-08 08:57:03'; + public const RELEASE_DATE = '2023-10-08 10:14:26'; /** * @var int */