From 9ab2b8bc07c06b11da0d2243b46f1669dd5c7142 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 16 Mar 2024 08:29:12 +0000 Subject: [PATCH] Updated Rector to commit d1ed5f03202cb9325f861ac7b8c1976173b45826 https://github.com/rectorphp/rector-src/commit/d1ed5f03202cb9325f861ac7b8c1976173b45826 [php84] Clean up contains null check type on ExplicitNullableParamTypeRector (#5726) --- .../Php84/Rector/Param/ExplicitNullableParamTypeRector.php | 7 +------ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/rules/Php84/Rector/Param/ExplicitNullableParamTypeRector.php b/rules/Php84/Rector/Param/ExplicitNullableParamTypeRector.php index 800fb44c024..2e9a37cd4f8 100644 --- a/rules/Php84/Rector/Param/ExplicitNullableParamTypeRector.php +++ b/rules/Php84/Rector/Param/ExplicitNullableParamTypeRector.php @@ -6,7 +6,6 @@ namespace Rector\Php84\Rector\Param; use PhpParser\Node; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Param; -use PHPStan\Type\NullType; use PHPStan\Type\TypeCombinator; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\PHPStanStaticTypeMapper\Enum\TypeKind; @@ -62,11 +61,7 @@ CODE_SAMPLE return null; } $nodeType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($node->type); - if ($nodeType instanceof NullType) { - return null; - } - $removedNullNodeType = TypeCombinator::removeNull($nodeType); - if (!$nodeType->equals($removedNullNodeType)) { + if (TypeCombinator::containsNull($nodeType)) { return null; } $newNodeType = TypeCombinator::addNull($nodeType); diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 2fde9886c46..92f2e3a763e 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 = 'cdde425c2224a1357d70d6784936fe47fe3ffee0'; + public const PACKAGE_VERSION = 'd1ed5f03202cb9325f861ac7b8c1976173b45826'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-03-15 20:22:53'; + public const RELEASE_DATE = '2024-03-16 08:26:52'; /** * @var int */