From 283153802aa448ef2e6a16108be4d5389d59ae53 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 21 Feb 2024 16:18:55 +0000 Subject: [PATCH] Updated Rector to commit 99a79f8df18f4202f7c939b7996b9714abb78fe4 https://github.com/rectorphp/rector-src/commit/99a79f8df18f4202f7c939b7996b9714abb78fe4 [TypeDeclaration] Fix abs() returns on ReturnTypeFromStrictTypedCallRector (#5652) --- .../TypeAnalyzer/ReturnStrictTypeAnalyzer.php | 9 +++++---- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php index f656113ac60..75efdaff9f2 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace Rector\TypeDeclaration\TypeAnalyzer; +use PHPStan\Reflection\ParametersAcceptorSelector; use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\Array_; @@ -98,12 +99,12 @@ final class ReturnStrictTypeAnalyzer if ($methodReflection === null) { return null; } - $parametersAcceptor = $methodReflection->getVariants()[0]; - if ($parametersAcceptor instanceof FunctionVariantWithPhpDocs) { + $parametersAcceptorWithPhpDocs = ParametersAcceptorSelector::combineAcceptors($methodReflection->getVariants()); + if ($parametersAcceptorWithPhpDocs instanceof FunctionVariantWithPhpDocs) { // native return type is needed, as docblock can be false - $returnType = $parametersAcceptor->getNativeReturnType(); + $returnType = $parametersAcceptorWithPhpDocs->getNativeReturnType(); } else { - $returnType = $parametersAcceptor->getReturnType(); + $returnType = $parametersAcceptorWithPhpDocs->getReturnType(); } if ($returnType instanceof MixedType) { return null; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 3154a4f5ba1..7d7404f6433 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 = '290926cc8b93331dd715d7ea061847dafbc1821a'; + public const PACKAGE_VERSION = '99a79f8df18f4202f7c939b7996b9714abb78fe4'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-02-21 15:28:36'; + public const RELEASE_DATE = '2024-02-21 23:16:34'; /** * @var int */