Skip to content

Commit 2cd967e

Browse files
committed
InClassMethodNode - contains ExtendedMethodReflection
1 parent 5f16444 commit 2cd967e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Analyser/NodeScopeResolver.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
use PHPStan\PhpDoc\StubPhpDocProvider;
108108
use PHPStan\Reflection\Assertions;
109109
use PHPStan\Reflection\ClassReflection;
110+
use PHPStan\Reflection\ExtendedMethodReflection;
110111
use PHPStan\Reflection\FunctionReflection;
111112
use PHPStan\Reflection\InitializerExprTypeResolver;
112113
use PHPStan\Reflection\MethodReflection;
@@ -527,7 +528,7 @@ private function processStmtNode(
527528

528529
if ($stmt->getAttribute('virtual', false) === false) {
529530
$methodReflection = $methodScope->getFunction();
530-
if (!$methodReflection instanceof MethodReflection) {
531+
if (!$methodReflection instanceof ExtendedMethodReflection) {
531532
throw new ShouldNotHappenException();
532533
}
533534
$nodeCallback(new InClassMethodNode($methodReflection, $stmt), $methodScope);

src/Node/InClassMethodNode.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\MethodReflection;
6+
use PHPStan\Reflection\ExtendedMethodReflection;
77

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

1212
public function __construct(
13-
private MethodReflection $methodReflection,
13+
private ExtendedMethodReflection $methodReflection,
1414
private Node\Stmt\ClassMethod $originalNode,
1515
)
1616
{
1717
parent::__construct($originalNode->getAttributes());
1818
}
1919

20-
public function getMethodReflection(): MethodReflection
20+
public function getMethodReflection(): ExtendedMethodReflection
2121
{
2222
return $this->methodReflection;
2323
}

0 commit comments

Comments
 (0)