From a3f6293c8b6f372a1f87b911c23fc32409a5ff21 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 1 Oct 2024 13:54:55 +0000 Subject: [PATCH] Updated Rector to commit 0c9edebe4e1ca753d5bbe99e5109378155e87dde https://github.com/rectorphp/rector-src/commit/0c9edebe4e1ca753d5bbe99e5109378155e87dde [TypeDeclaration] Add NativeMethodReflection support on ReturnStrictTypeAnalyzer (#6344) --- .../TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php | 3 ++- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php index 5f38a0b6ae8..0cc79cacf24 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/ReturnStrictTypeAnalyzer.php @@ -21,6 +21,7 @@ use PHPStan\Analyser\Scope; use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\Native\NativeFunctionReflection; +use PHPStan\Reflection\Native\NativeMethodReflection; use PHPStan\Reflection\ParametersAcceptorWithPhpDocs; use PHPStan\Type\MixedType; use PHPStan\Type\StaticType; @@ -117,7 +118,7 @@ public function resolveMethodCallReturnType($call) : ?Type return null; } $parametersAcceptorWithPhpDocs = ParametersAcceptorSelectorVariantsWrapper::select($methodReflection, $call, $scope); - if ($methodReflection instanceof NativeFunctionReflection) { + if ($methodReflection instanceof NativeFunctionReflection || $methodReflection instanceof NativeMethodReflection) { $returnType = $parametersAcceptorWithPhpDocs->getReturnType(); } elseif ($parametersAcceptorWithPhpDocs instanceof ParametersAcceptorWithPhpDocs) { // native return type is needed, as docblock can be false diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0421d536241..24702381408 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 = 'd17d3e814eada2fa3ada3601034407df01d84568'; + public const PACKAGE_VERSION = '0c9edebe4e1ca753d5bbe99e5109378155e87dde'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-01 20:02:39'; + public const RELEASE_DATE = '2024-10-01 20:52:27'; /** * @var int */