Skip to content

Commit c14b6e1

Browse files
committed
Updated PHPStan
1 parent 2b47d60 commit c14b6e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Rules/StrictCalls/DynamicCallOnStaticMethodsRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Rules\RuleLevelHelper;
99
use PHPStan\Type\ErrorType;
10+
use PHPStan\Type\Type;
1011

1112
class DynamicCallOnStaticMethodsRule implements \PHPStan\Rules\Rule
1213
{
@@ -39,7 +40,10 @@ public function processNode(Node $node, Scope $scope): array
3940
$type = $this->ruleLevelHelper->findTypeToCheck(
4041
$scope,
4142
$node->var,
42-
''
43+
'',
44+
function (Type $type) use ($name): bool {
45+
return $type->canCallMethods()->yes() && $type->hasMethod($name);
46+
}
4347
)->getType();
4448

4549
if ($type instanceof ErrorType || !$type->canCallMethods()->yes() || !$type->hasMethod($name)) {

0 commit comments

Comments
 (0)