Skip to content

Commit 51139d3

Browse files
committed
Fixes
1 parent de8683a commit 51139d3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Rules/Deprecations/TypeHintDeprecatedInClosureSignatureRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Node\InClosureNode;
8-
use PHPStan\Reflection\ParametersAcceptor;
98
use PHPStan\Rules\Rule;
109
use PHPStan\ShouldNotHappenException;
1110
use function sprintf;
@@ -36,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
3635
}
3736

3837
$functionSignature = $scope->getAnonymousFunctionReflection();
39-
if (!$functionSignature instanceof ParametersAcceptor) {
38+
if ($functionSignature === null) {
4039
throw new ShouldNotHappenException();
4140
}
4241

src/Rules/Deprecations/TypeHintDeprecatedInFunctionSignatureRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Node\InFunctionNode;
8-
use PHPStan\Reflection\FunctionReflection;
98
use PHPStan\Reflection\ParametersAcceptorSelector;
109
use PHPStan\Rules\Rule;
1110
use PHPStan\ShouldNotHappenException;
@@ -37,7 +36,7 @@ public function processNode(Node $node, Scope $scope): array
3736
}
3837

3938
$function = $scope->getFunction();
40-
if (!$function instanceof FunctionReflection) {
39+
if ($function === null) {
4140
throw new ShouldNotHappenException();
4241
}
4342
$functionSignature = ParametersAcceptorSelector::selectSingle($function->getVariants());

0 commit comments

Comments
 (0)