We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05d42df commit 5f16444Copy full SHA for 5f16444
src/Rules/PhpDoc/IncompatibleSelfOutTypeRule.php
@@ -7,7 +7,6 @@
7
use PHPStan\Node\InClassMethodNode;
8
use PHPStan\Rules\Rule;
9
use PHPStan\Rules\RuleErrorBuilder;
10
-use PHPStan\ShouldNotHappenException;
11
use PHPStan\Type\ObjectType;
12
use PHPStan\Type\VerbosityLevel;
13
use function sprintf;
@@ -25,11 +24,7 @@ public function getNodeType(): string
25
24
26
public function processNode(Node $node, Scope $scope): array
27
{
28
- $method = $scope->getFunction();
29
- if ($method === null) {
30
- throw new ShouldNotHappenException();
31
- }
32
-
+ $method = $node->getMethodReflection();
33
$selfOutType = $method->getSelfOutType();
34
if ($selfOutType === null) {
35
return [];
0 commit comments