Skip to content

Commit

Permalink
MethodReturnStatementsNode - use ExtendedMethodReflection
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Mar 13, 2024
1 parent 094b787 commit 3cc1a54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Analyser/NodeScopeResolver.php
Expand Up @@ -634,7 +634,7 @@ private function processStmtNode(
$classReflection = $scope->getClassReflection();

$methodReflection = $methodScope->getFunction();
if (!$methodReflection instanceof MethodReflection) {
if (!$methodReflection instanceof ExtendedMethodReflection) {
throw new ShouldNotHappenException();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Node/MethodReturnStatementsNode.php
Expand Up @@ -8,7 +8,7 @@
use PhpParser\NodeAbstract;
use PHPStan\Analyser\StatementResult;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\ExtendedMethodReflection;
use function count;

/** @api */
Expand All @@ -29,7 +29,7 @@ public function __construct(
private StatementResult $statementResult,
private array $executionEnds,
private ClassReflection $classReflection,
private MethodReflection $methodReflection,
private ExtendedMethodReflection $methodReflection,
)
{
parent::__construct($method->getAttributes());
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getClassReflection(): ClassReflection
return $this->classReflection;
}

public function getMethodReflection(): MethodReflection
public function getMethodReflection(): ExtendedMethodReflection
{
return $this->methodReflection;
}
Expand Down

0 comments on commit 3cc1a54

Please sign in to comment.