@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | protected function updateTimestamps(array $values) |
| 64 | 64 | { |
| 65 | - if (! $this->model->usesTimestamps() || |
|
| 65 | + if (!$this->model->usesTimestamps() || |
|
| 66 | 66 | is_null($this->model->getUpdatedAtColumn()) || |
| 67 | 67 | is_null($this->model->getCreatedAtColumn())) { |
| 68 | 68 | return $values; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $timestamps[$updatedAtColumn] = $timestamp; |
| 73 | 73 | |
| 74 | 74 | $createdAtColumn = $this->model->getCreatedAtColumn(); |
| 75 | - if (! isset($values[$createdAtColumn]) && ! isset($this->model->$createdAtColumn)) { |
|
| 75 | + if (!isset($values[$createdAtColumn]) && !isset($this->model->$createdAtColumn)) { |
|
| 76 | 76 | $timestamps[$createdAtColumn] = $timestamp; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | protected function generateTableAlias($builder, $table, $postfix = 'Doc') |
| 95 | 95 | { |
| 96 | - $builder->registerAlias($table, Str::singular($table) . $postfix); |
|
| 96 | + $builder->registerAlias($table, Str::singular($table).$postfix); |
|
| 97 | 97 | |
| 98 | 98 | return $builder; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | protected function prefixTable($table) |
| 102 | 102 | { |
| 103 | - return $this->tablePrefix . $table; |
|
| 103 | + return $this->tablePrefix.$table; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | // see if that component exists. If it does we'll just call the compiler |
| 187 | 187 | // function for the component which is responsible for making the SQL. |
| 188 | 188 | |
| 189 | - if (isset($builder->$component) && ! is_null($builder->$component)) { |
|
| 190 | - $method = 'compile' . ucfirst($component); |
|
| 189 | + if (isset($builder->$component) && !is_null($builder->$component)) { |
|
| 190 | + $method = 'compile'.ucfirst($component); |
|
| 191 | 191 | |
| 192 | 192 | $builder = $this->$method($builder, $builder->$component); |
| 193 | 193 | } |
@@ -223,12 +223,12 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function compileJoins(Builder $query, $joins) |
| 225 | 225 | { |
| 226 | - return collect($joins)->map(function ($join) use ($query) { |
|
| 226 | + return collect($joins)->map(function($join) use ($query) { |
|
| 227 | 227 | $table = $this->wrapTable($join->table); |
| 228 | 228 | |
| 229 | - $nestedJoins = is_null($join->joins) ? '' : ' ' . $this->compileJoins($query, $join->joins); |
|
| 229 | + $nestedJoins = is_null($join->joins) ? '' : ' '.$this->compileJoins($query, $join->joins); |
|
| 230 | 230 | |
| 231 | - $tableAndNestedJoins = is_null($join->joins) ? $table : '(' . $nestedJoins . ')'; |
|
| 231 | + $tableAndNestedJoins = is_null($join->joins) ? $table : '('.$nestedJoins.')'; |
|
| 232 | 232 | |
| 233 | 233 | return trim("{$join->type} join {$tableAndNestedJoins} {$this->compileWheres($join)}"); |
| 234 | 234 | })->implode(' '); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | protected function compileWheresToArray($builder) |
| 269 | 269 | { |
| 270 | - $result = collect($builder->wheres)->map(function ($where) use ($builder) { |
|
| 270 | + $result = collect($builder->wheres)->map(function($where) use ($builder) { |
|
| 271 | 271 | if (isset($where['operator'])) { |
| 272 | 272 | $where['operator'] = $this->translateOperator($where['operator']); |
| 273 | 273 | } else { |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | protected function compileAggregate(Builder $builder, $aggregate) |
| 306 | 306 | { |
| 307 | - $method = 'compile' . ucfirst($aggregate['function']); |
|
| 307 | + $method = 'compile'.ucfirst($aggregate['function']); |
|
| 308 | 308 | |
| 309 | 309 | return $this->$method($builder, $aggregate); |
| 310 | 310 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | protected function compileOrders(Builder $builder, $orders) |
| 397 | 397 | { |
| 398 | - if (! empty($orders)) { |
|
| 398 | + if (!empty($orders)) { |
|
| 399 | 399 | $builder->aqb = $builder->aqb->sort($this->compileOrdersToArray($builder, $orders)); |
| 400 | 400 | |
| 401 | 401 | return $builder; |
@@ -413,8 +413,8 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | protected function compileOrdersToArray(Builder $builder, $orders) |
| 415 | 415 | { |
| 416 | - return array_map(function ($order) use ($builder) { |
|
| 417 | - if (! isset($order['type']) || $order['type'] != 'Raw') { |
|
| 416 | + return array_map(function($order) use ($builder) { |
|
| 417 | + if (!isset($order['type']) || $order['type'] != 'Raw') { |
|
| 418 | 418 | $order['column'] = $this->prefixAlias($builder, $builder->from, $order['column']); |
| 419 | 419 | } |
| 420 | 420 | unset($order['type']); |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $doc = $builder->getAlias($builder->from); |
| 472 | 472 | foreach ($columns as $column) { |
| 473 | 473 | if ($column != null && $column != '*') { |
| 474 | - $values[$column] = $doc . '.' . $column; |
|
| 474 | + $values[$column] = $doc.'.'.$column; |
|
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | if ($builder->aggregate !== null) { |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | $builder = $this->generateTableAlias($builder, $table); |
| 522 | 522 | $tableAlias = $builder->getAlias($table); |
| 523 | 523 | |
| 524 | - if (! is_null($_key)) { |
|
| 524 | + if (!is_null($_key)) { |
|
| 525 | 525 | $builder->aqb = $builder->aqb->remove((string) $_key, $table)->get(); |
| 526 | 526 | |
| 527 | 527 | return $builder; |
@@ -582,10 +582,10 @@ discard block |
||
| 582 | 582 | { |
| 583 | 583 | $alias = $builder->getAlias($target); |
| 584 | 584 | |
| 585 | - if (Str::startsWith($value, $alias . '.')) { |
|
| 585 | + if (Str::startsWith($value, $alias.'.')) { |
|
| 586 | 586 | return $value; |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | - return $alias . '.' . $value; |
|
| 589 | + return $alias.'.'.$value; |
|
| 590 | 590 | } |
| 591 | 591 | } |