From c578222ddf22eecbef5c4e823dc6b5462d22daec Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 12 Dec 2024 01:15:05 +0000 Subject: [PATCH] Updated Rector to commit 184eb2ed84405c011740792f1fee4e914e11b445 https://github.com/rectorphp/rector-src/commit/184eb2ed84405c011740792f1fee4e914e11b445 [TypeDeclaration] Handle default value with contant type on TypedPropertyFromAssignsRector (#6563) --- .../TypeInferer/AssignToPropertyTypeInferer.php | 5 +---- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php b/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php index d988bc275d9..433fb122eee 100644 --- a/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php +++ b/rules/TypeDeclaration/TypeInferer/AssignToPropertyTypeInferer.php @@ -120,13 +120,10 @@ private function resolveTypeWithVerifyDefaultValue(Property $property, array $as return null; } $inferredType = $this->typeFactory->createMixedPassedOrUnionType($assignedExprTypes); - // to compare with default value, constant type must not be kept - // eg, use more general bool over false or true if ($this->shouldSkipWithDifferentDefaultValueType($defaultPropertyValue, $inferredType)) { return null; } - // returns with constant as final result - return $this->typeFactory->createMixedPassedOrUnionType($assignedExprTypes, \true); + return $inferredType; } private function shouldSkipWithDifferentDefaultValueType(?Expr $expr, Type $inferredType) : bool { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 5e70ac77584..564621d5a12 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 = '457927353525b5f87771493eaa7f79523383b071'; + public const PACKAGE_VERSION = '184eb2ed84405c011740792f1fee4e914e11b445'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-12-12 07:46:01'; + public const RELEASE_DATE = '2024-12-12 08:12:34'; /** * @var int */