Skip to content

Commit 608d2bc

Browse files
committed
Updated PHPStan
1 parent 9630213 commit 608d2bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Rules/Methods/MissingMethodParameterTypehintRule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Reflection\MethodReflection;
88
use PHPStan\Reflection\ParameterReflection;
9+
use PHPStan\Reflection\ParametersAcceptorSelector;
910
use PHPStan\Type\MixedType;
1011

1112
final class MissingMethodParameterTypehintRule implements \PHPStan\Rules\Rule
@@ -35,7 +36,7 @@ public function processNode(Node $node, Scope $scope): array
3536

3637
$messages = [];
3738

38-
foreach ($methodReflection->getParameters() as $parameterReflection) {
39+
foreach (ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getParameters() as $parameterReflection) {
3940
$message = $this->checkMethodParameter($methodReflection, $parameterReflection);
4041
if ($message === null) {
4142
continue;

src/Rules/Methods/MissingMethodReturnTypehintRule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Reflection\MethodReflection;
8+
use PHPStan\Reflection\ParametersAcceptorSelector;
89
use PHPStan\Type\MixedType;
910

1011
final class MissingMethodReturnTypehintRule implements \PHPStan\Rules\Rule
@@ -44,7 +45,7 @@ public function processNode(Node $node, Scope $scope): array
4445

4546
private function checkMethodReturnType(MethodReflection $methodReflection): ?string
4647
{
47-
$returnType = $methodReflection->getReturnType();
48+
$returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
4849

4950
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
5051
return sprintf(

0 commit comments

Comments
 (0)