Skip to content

Commit 011fa56

Browse files
author
Etienne V. Labelle
committed
fix: check var type instead of declaring class to support PDOStatement subclasses
1 parent 23c4b10 commit 011fa56

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Rules/PdoStatementExecuteMethodRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function processNode(Node $methodCall, Scope $scope): array
4343
return [];
4444
}
4545

46-
if (PDOStatement::class !== $methodReflection->getDeclaringClass()->getName()) {
46+
if (!(new \PHPStan\Type\ObjectType(PDOStatement::class))->isSuperTypeOf($scope->getType($methodCall->var))->yes()) {
4747
return [];
4848
}
4949

0 commit comments

Comments
 (0)