Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class ReturnQueryBuilderExpressionTypeResolverExtension implements ExpressionTyp

private OtherMethodQueryBuilderParser $otherMethodQueryBuilderParser;

/** @var array<string, bool> */
private array $queryBuilderClasses = [];

public function __construct(
OtherMethodQueryBuilderParser $otherMethodQueryBuilderParser
)
Expand Down Expand Up @@ -85,7 +88,8 @@ private function getMethodReflection(CallLike $call, Scope $scope): ?MethodRefle
$methodName = $call->name->name;

foreach ($callerType->getObjectClassReflections() as $callerClassReflection) {
if ($callerClassReflection->is(QueryBuilder::class)) {
$className = $callerClassReflection->getName();
if (($this->queryBuilderClasses[$className] ??= $callerClassReflection->is(QueryBuilder::class))) {
return null; // covered by QueryBuilderMethodDynamicReturnTypeExtension

@staabm staabm Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OT: this comment made me curious. looking into QueryBuilderMethodDynamicReturnTypeExtension and
made me realize that we have a config arround to declare what the QueryBuilder class is, since 4d630c6

}
if ($methodName === 'createQueryBuilder' && $callerClassReflection->is(EntityRepository::class)) {
Expand Down
Loading