Skip to content

Commit

Permalink
[TypeDeclaration] Add NativeMethodReflection support on ReturnStrictT…
Browse files Browse the repository at this point in the history
…ypeAnalyzer
  • Loading branch information
samsonasik committed Oct 1, 2024
1 parent d17d3e8 commit aa7e3f5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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;
Expand Down Expand Up @@ -122,7 +123,7 @@ public function resolveMethodCallReturnType(MethodCall | StaticCall | FuncCall $
$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
Expand Down

0 comments on commit aa7e3f5

Please sign in to comment.