diff --git a/src/Expression/ExpressionBuilder.php b/src/Expression/ExpressionBuilder.php index 4c9b020d9..862c839b0 100644 --- a/src/Expression/ExpressionBuilder.php +++ b/src/Expression/ExpressionBuilder.php @@ -23,7 +23,7 @@ */ class ExpressionBuilder implements ExpressionBuilderInterface { - public function __construct(private QueryBuilderInterface $queryBuilder) + public function __construct(private QueryBuilderInterface|null $queryBuilder = null) { } @@ -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; }