Skip to content

Commit 5f16444

Browse files
committed
Fix custom rule
1 parent 05d42df commit 5f16444

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Rules/PhpDoc/IncompatibleSelfOutTypeRule.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use PHPStan\Node\InClassMethodNode;
88
use PHPStan\Rules\Rule;
99
use PHPStan\Rules\RuleErrorBuilder;
10-
use PHPStan\ShouldNotHappenException;
1110
use PHPStan\Type\ObjectType;
1211
use PHPStan\Type\VerbosityLevel;
1312
use function sprintf;
@@ -25,11 +24,7 @@ public function getNodeType(): string
2524

2625
public function processNode(Node $node, Scope $scope): array
2726
{
28-
$method = $scope->getFunction();
29-
if ($method === null) {
30-
throw new ShouldNotHappenException();
31-
}
32-
27+
$method = $node->getMethodReflection();
3328
$selfOutType = $method->getSelfOutType();
3429
if ($selfOutType === null) {
3530
return [];

0 commit comments

Comments
 (0)