Skip to content

Commit

Permalink
No useless dive into EM::createQueryBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Dec 4, 2023
1 parent fefba05 commit 2d0ceb3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace PHPStan\Type\Doctrine\QueryBuilder;

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use PhpParser\Node\Expr;
Expand Down Expand Up @@ -91,6 +92,9 @@ private function getMethodReflection(CallLike $call, Scope $scope): ?MethodRefle
if ($callerClassReflection->is(EntityRepository::class) && $methodName === 'createQueryBuilder') {
return null; // covered by EntityRepositoryCreateQueryBuilderDynamicReturnTypeExtension
}
if ($callerClassReflection->is(EntityManagerInterface::class) && $methodName === 'createQueryBuilder') {
return null; // no need to dive there
}
}

return $scope->getMethodReflection($callerType, $methodName);
Expand Down

0 comments on commit 2d0ceb3

Please sign in to comment.