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 authored and ondrejmirtes committed Jan 5, 2024
1 parent 1dcec03 commit 4d9c203
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 4d9c203

Please sign in to comment.