From cdbdb1bd14a6fda29bd3d2caf4039c840290a7dc Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 1 Oct 2024 11:13:08 +0000 Subject: [PATCH] Updated Rector to commit 697b37b340c3b4c73ad6f8e4cea26b7bf60ddf62 https://github.com/rectorphp/rector-src/commit/697b37b340c3b4c73ad6f8e4cea26b7bf60ddf62 Around PHPStan 1.12.4 handling on ParametersAcceptors with non-native return type (by docblock) (#6341) --- .../TypeAnalyzer/ReturnStrictTypeAnalyzer.php | 7 +++++++ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php index e2f5dfc74e1..42e0c614c81 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php @@ -121,6 +121,13 @@ public function resolveMethodCallReturnType($call) : ?Type $returnType = $parametersAcceptorWithPhpDocs->getNativeReturnType(); } else { $returnType = $parametersAcceptorWithPhpDocs->getReturnType(); + // around PHPStan 1.12.4+ handling + if (\method_exists($parametersAcceptorWithPhpDocs, 'getNativeReturnType')) { + $nativeReturnType = $parametersAcceptorWithPhpDocs->getNativeReturnType(); + if ($nativeReturnType instanceof MixedType && !$nativeReturnType->isExplicitMixed()) { + $returnType = $nativeReturnType; + } + } } if ($returnType instanceof MixedType) { if ($returnType->isExplicitMixed()) { diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 82c2b5c46ee..c204eb483bd 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 = 'a11fc615d18396cef284c18de269711114630676'; + public const PACKAGE_VERSION = '697b37b340c3b4c73ad6f8e4cea26b7bf60ddf62'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-01 16:53:21'; + public const RELEASE_DATE = '2024-10-01 18:10:51'; /** * @var int */