Skip to content

Commit 71f22e7

Browse files
committed
Fix call to ParserNodeTypeToPHPStanType in FunctionDefinitionCheck
1 parent c985b85 commit 71f22e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Rules/FunctionDefinitionCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ private function checkParametersAcceptor(
464464
}
465465

466466
if ($this->phpVersion->supportsPureIntersectionTypes() && $functionNode->getReturnType() !== null) {
467-
$nativeReturnType = ParserNodeTypeToPHPStanType::resolve($functionNode->getReturnType(), null);
467+
$nativeReturnType = ParserNodeTypeToPHPStanType::resolve($functionNode->getReturnType(), $scope->isInClass() ? $scope->getClassReflection() : null);
468468
if ($this->unresolvableTypeHelper->containsUnresolvableType($nativeReturnType)) {
469469
$errors[] = RuleErrorBuilder::message($unresolvableReturnTypeMessage)
470470
->nonIgnorable()

0 commit comments

Comments
 (0)