Skip to content

Commit

Permalink
Fix internal error
Browse files Browse the repository at this point in the history
Closes #602
  • Loading branch information
ondrejmirtes committed Sep 1, 2024
1 parent 7414a7d commit 38db3ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Type/Doctrine/ArgumentsProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public function processArgs(
{
$args = [];
foreach ($methodCallArgs as $arg) {
if ($arg->unpack) {
throw new DynamicQueryBuilderArgumentException();
}
$value = $scope->getType($arg->value);
if (
$value instanceof ExprType
Expand Down
9 changes: 7 additions & 2 deletions tests/Rules/Doctrine/ORM/data/query-builder-dql.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,17 @@ public function qbExprMethod(): void
$queryBuilder->getQuery();
}

public function bug602(array $objectConditions): void
public function bug602(array $objectConditions, bool $rand): void
{
$orParts = ['e.title LIKE :termLike'];
if ($rand) {
$orParts[] = 'p.version = :term';
}
$queryBuilder = $this->entityManager->createQueryBuilder();
$queryBuilder->select('e')
->from(MyEntity::class, 'e')
->andWhere($queryBuilder->expr()->orX(...$objectConditions));
->andWhere($queryBuilder->expr()->orX(...$orParts))
->setParameter('termLike', 'someTerm');
}

}
Expand Down

0 comments on commit 38db3ba

Please sign in to comment.