Skip to content

Commit 6f97e2c

Browse files
committed
Bracket Expression: fix position
1 parent 13ea90c commit 6f97e2c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/SQLParser/Node/Expression.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,15 @@ public function toSql(array $parameters, AbstractPlatform $platform, int $indent
214214
return null;
215215
}
216216

217+
if ($this->brackets) {
218+
$sql = '('.$sql.')';
219+
}
217220
if ($this->alias) {
218221
$sql .= ' AS '.$this->alias;
219222
}
220223
if ($this->direction) {
221224
$sql .= ' '.$this->direction;
222225
}
223-
if ($this->brackets) {
224-
$sql = '('.$sql.')';
225-
}
226-
227226

228227
return $sql;
229228
}

0 commit comments

Comments
 (0)