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 */