Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0f05c71

Browse files
Fix
1 parent c561fe0 commit 0f05c71

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

‎src/Rules/Deprecations/TypeHintDeprecatedInClassMethodSignatureRule.php‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Node\InClassMethodNode;
8-
use PHPStan\Reflection\MethodReflection;
98
use PHPStan\Reflection\ParametersAcceptorSelector;
109
use PHPStan\Rules\Rule;
11-
use PHPStan\ShouldNotHappenException;
1210
use function sprintf;
1311

1412
/**
@@ -36,11 +34,7 @@ public function processNode(Node $node, Scope $scope): array
3634
return [];
3735
}
3836

39-
/** @var MethodReflection $method */
40-
$method = $scope->getFunction();
41-
if (!$method instanceof MethodReflection) {
42-
throw new ShouldNotHappenException();
43-
}
37+
$method = $node->getMethodReflection();
4438
$methodSignature = ParametersAcceptorSelector::selectSingle($method->getVariants());
4539

4640
$errors = [];

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /