Skip to content

Commit 6429c41

Browse files
Simplify
1 parent e4522ee commit 6429c41

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/Analyser/ExprHandler/StaticCallHandler.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
145145
$throwPoints[] = InternalThrowPoint::createImplicit($scope, $expr);
146146
}
147147
} elseif ($expr->class instanceof Expr) {
148-
$classType = TypeCombinator::removeNull($scope->getType($expr->class))->getObjectTypeOrClassStringObjectType();
148+
$classType = $scope->getType($expr->class)->getObjectTypeOrClassStringObjectType();
149149
$methodName = $expr->name->name;
150150
$methodReflection = $scope->getMethodReflection($classType, $methodName);
151151
if ($methodReflection !== null) {

‎tests/PHPStan/Rules/Methods/data/dynamic-static-call.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ final static public function finalFoo():int
2929

3030
class Baz {
3131
function doBaz(Foo $foo, FinalFoo $finalFoo, Bar $bar):void {
32-
$foo::doFoo(); // no error, subclass could override static method with impure impl
33-
$finalFoo::doFoo(); // could be "Call to static method .. on a separate line has no effect", because final class
34-
$bar::finalFoo(); // could be "Call to static method .. on a separate line has no effect", because final method
32+
$foo::doFoo();
33+
$finalFoo::doFoo();
34+
$bar::finalFoo();
3535
}
3636
}

0 commit comments

Comments
 (0)