Skip to content

Commit

Permalink
Fix code styling (ci skip)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsverre authored and github-actions[bot] committed Dec 1, 2022
1 parent 943a303 commit e36e749
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/Query/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected function wrapUnion($sql): string
/**
* Compile the "union" queries attached to the main query.
*
* @param Builder $query
* @param Builder $query
* @return string
*/
protected function compileUnions(Builder $query): string
Expand All @@ -154,15 +154,15 @@ protected function compileUnions(Builder $query): string
/**
* Compile a select query into SQL.
*
* @param Builder $query
* @param Builder $query
* @return string
*/
public function compileSelect(Builder $query): string
{
$sql = parent::compileSelect($query);

if (! empty($query->unionOrders) || isset($query->unionLimit) || isset($query->unionOffset)) {
$sql = "SELECT * FROM (".$sql.") ";
$sql = 'SELECT * FROM ('.$sql.') ';

if (! empty($query->unionOrders)) {
$sql .= ' '.$this->compileOrders($query, $query->unionOrders);
Expand All @@ -184,7 +184,7 @@ public function compileSelect(Builder $query): string
* Compile the "offset" portions of the query.
*
* @param Builder $query
* @param $offset
* @param $offset
* @return string
*/
protected function compileOffset(Builder $query, $offset): string
Expand Down
21 changes: 14 additions & 7 deletions tests/Hybrid/UnionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ protected function setUp(): void
}

/** @test */
function union() {
public function union()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -48,7 +49,8 @@ function union() {
}

/** @test */
function unionAll() {
public function unionAll()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -66,7 +68,8 @@ function unionAll() {
}

/** @test */
function unionWithOrderByLimitAndOffset() {
public function unionWithOrderByLimitAndOffset()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -83,7 +86,8 @@ function unionWithOrderByLimitAndOffset() {
}

/** @test */
function unionWithOrderBy() {
public function unionWithOrderBy()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -100,7 +104,8 @@ function unionWithOrderBy() {
}

/** @test */
function unionWithLimit() {
public function unionWithLimit()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -113,7 +118,8 @@ function unionWithLimit() {
}

/** @test */
function unionWithOffset() {
public function unionWithOffset()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand All @@ -126,7 +132,8 @@ function unionWithOffset() {
}

/** @test */
function unionWithInnerOffset() {
public function unionWithInnerOffset()
{
if (! $this->runHybridIntegrations()) {
return;
}
Expand Down

0 comments on commit e36e749

Please sign in to comment.