diff --git a/SqlBuilder.php b/SqlBuilder.php index 0ae3d5b..ffcb51b 100644 --- a/SqlBuilder.php +++ b/SqlBuilder.php @@ -216,7 +216,7 @@ class SqlBuilder extends Component public function one(): string { $this->query->offset(0)->limit(1); - return $this->makeSelect($this->query) . $this->make() . $this->makeLimit(); + return join('', [$this->makeSelect($this->query), $this->make(), $this->makeLimit()]); } @@ -226,7 +226,7 @@ class SqlBuilder extends Component */ public function all(): string { - return $this->makeSelect($this->query) . $this->make() . $this->makeLimit(); + return join('', [$this->makeSelect($this->query), $this->make(), $this->makeLimit()]); } @@ -236,7 +236,7 @@ class SqlBuilder extends Component */ public function count(): string { - return $this->makeSelect(['COUNT(*)']) . $this->make(); + return join(' ', [$this->makeSelect(['COUNT(*)']), $this->make()]); } @@ -246,7 +246,7 @@ class SqlBuilder extends Component */ public function exists(): string { - return $this->makeSelect(['0']) . $this->make(); + return join(' ', [$this->makeSelect(['0']), $this->make()]); }