Skip to content

Commit e864b24

Browse files
committed
InFunctionNode always contains PhpFunctionFromParserNodeReflection
1 parent 01a7897 commit e864b24

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: src/Analyser/NodeScopeResolver.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
use PHPStan\Reflection\ParameterReflectionWithPhpDocs;
119119
use PHPStan\Reflection\ParametersAcceptor;
120120
use PHPStan\Reflection\ParametersAcceptorSelector;
121+
use PHPStan\Reflection\Php\PhpFunctionFromParserNodeReflection;
121122
use PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection;
122123
use PHPStan\Reflection\Php\PhpMethodReflection;
123124
use PHPStan\Reflection\ReflectionProvider;
@@ -443,7 +444,7 @@ private function processStmtNode(
443444
$phpDocParameterOutTypes,
444445
);
445446
$functionReflection = $functionScope->getFunction();
446-
if (!$functionReflection instanceof FunctionReflection) {
447+
if (!$functionReflection instanceof PhpFunctionFromParserNodeReflection) {
447448
throw new ShouldNotHappenException();
448449
}
449450

Diff for: src/Node/InFunctionNode.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
namespace PHPStan\Node;
44

55
use PhpParser\Node;
6-
use PHPStan\Reflection\FunctionReflection;
6+
use PHPStan\Reflection\Php\PhpFunctionFromParserNodeReflection;
77

88
/** @api */
99
class InFunctionNode extends Node\Stmt implements VirtualNode
1010
{
1111

1212
public function __construct(
13-
private FunctionReflection $functionReflection,
13+
private PhpFunctionFromParserNodeReflection $functionReflection,
1414
private Node\Stmt\Function_ $originalNode,
1515
)
1616
{
1717
parent::__construct($originalNode->getAttributes());
1818
}
1919

20-
public function getFunctionReflection(): FunctionReflection
20+
public function getFunctionReflection(): PhpFunctionFromParserNodeReflection
2121
{
2222
return $this->functionReflection;
2323
}

0 commit comments

Comments
 (0)