Skip to content

Commit

Permalink
Resolve BC, make $queryBuilder optional in the constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Feb 11, 2024
1 parent 02708bb commit 5984d34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Expression/ExpressionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
class ExpressionBuilder implements ExpressionBuilderInterface
{
public function __construct(private QueryBuilderInterface $queryBuilder)
public function __construct(private QueryBuilderInterface|null $queryBuilder = null)
{
}

Expand All @@ -36,7 +36,7 @@ public function build(Expression $expression, array &$params = []): string
return $sql;
}

if (isset($params[0]) || isset($expressionParams[0])) {
if ($this->queryBuilder === null || isset($params[0]) || isset($expressionParams[0])) {
$params = array_merge($params, $expressionParams);
return $sql;

Check warning on line 41 in src/Expression/ExpressionBuilder.php

View check run for this annotation

Codecov / codecov/patch

src/Expression/ExpressionBuilder.php#L40-L41

Added lines #L40 - L41 were not covered by tests
}
Expand Down

0 comments on commit 5984d34

Please sign in to comment.