Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jun 17, 2022
1 parent de8683a commit 51139d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Node\InClosureNode;
use PHPStan\Reflection\ParametersAcceptor;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use function sprintf;
Expand Down Expand Up @@ -36,7 +35,7 @@ public function processNode(Node $node, Scope $scope): array
}

$functionSignature = $scope->getAnonymousFunctionReflection();
if (!$functionSignature instanceof ParametersAcceptor) {
if ($functionSignature === null) {
throw new ShouldNotHappenException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Node\InFunctionNode;
use PHPStan\Reflection\FunctionReflection;
use PHPStan\Reflection\ParametersAcceptorSelector;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
Expand Down Expand Up @@ -37,7 +36,7 @@ public function processNode(Node $node, Scope $scope): array
}

$function = $scope->getFunction();
if (!$function instanceof FunctionReflection) {
if ($function === null) {
throw new ShouldNotHappenException();
}
$functionSignature = ParametersAcceptorSelector::selectSingle($function->getVariants());
Expand Down

0 comments on commit 51139d3

Please sign in to comment.