@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $aqb = AQB::for('doc', $collection) |
|
| 38 | + $aqb = AQB::for ('doc', $collection) |
|
| 39 | 39 | ->filter($filter) |
| 40 | 40 | ->limit(1) |
| 41 | 41 | ->return('true') |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ['doc.'.$command->to], |
| 66 | 66 | ]; |
| 67 | 67 | |
| 68 | - $aqb = AQB::for('doc', $collection) |
|
| 68 | + $aqb = AQB::for ('doc', $collection) |
|
| 69 | 69 | ->filter($filter) |
| 70 | 70 | ->update( |
| 71 | 71 | 'doc', |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
| 102 | 102 | $data[$attribute] = 'null'; |
| 103 | 103 | } |
| 104 | - $aqb = AQB::for('doc', $collection) |
|
| 104 | + $aqb = AQB::for ('doc', $collection) |
|
| 105 | 105 | ->filter($filter) |
| 106 | 106 | ->update('doc', $data, $collection) |
| 107 | 107 | ->options(['keepNull' => false]) |
@@ -35,11 +35,12 @@ discard block |
||
| 35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $aqb = AQB::for('doc', $collection) |
|
| 39 | - ->filter($filter) |
|
| 38 | + $aqb = AQB::for('doc', $collection) { |
|
| 39 | + ->filter($filter) |
|
| 40 | 40 | ->limit(1) |
| 41 | 41 | ->return('true') |
| 42 | 42 | ->get(); |
| 43 | + } |
|
| 43 | 44 | |
| 44 | 45 | $command->aqb = $aqb; |
| 45 | 46 | |
@@ -65,8 +66,8 @@ discard block |
||
| 65 | 66 | ['doc.'.$command->to], |
| 66 | 67 | ]; |
| 67 | 68 | |
| 68 | - $aqb = AQB::for('doc', $collection) |
|
| 69 | - ->filter($filter) |
|
| 69 | + $aqb = AQB::for('doc', $collection) { |
|
| 70 | + ->filter($filter) |
|
| 70 | 71 | ->update( |
| 71 | 72 | 'doc', |
| 72 | 73 | [ |
@@ -76,6 +77,7 @@ discard block |
||
| 76 | 77 | $collection) |
| 77 | 78 | ->options(['keepNull' => true]) |
| 78 | 79 | ->get(); |
| 80 | + } |
|
| 79 | 81 | |
| 80 | 82 | $command->aqb = $aqb; |
| 81 | 83 | |
@@ -101,11 +103,12 @@ discard block |
||
| 101 | 103 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
| 102 | 104 | $data[$attribute] = 'null'; |
| 103 | 105 | } |
| 104 | - $aqb = AQB::for('doc', $collection) |
|
| 105 | - ->filter($filter) |
|
| 106 | + $aqb = AQB::for('doc', $collection) { |
|
| 107 | + ->filter($filter) |
|
| 106 | 108 | ->update('doc', $data, $collection) |
| 107 | 109 | ->options(['keepNull' => false]) |
| 108 | 110 | ->get(); |
| 111 | + } |
|
| 109 | 112 | |
| 110 | 113 | $command->aqb = $aqb; |
| 111 | 114 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return true; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if (! is_array(reset($values))) { |
|
| 45 | + if (!is_array(reset($values))) { |
|
| 46 | 46 | $values = [$values]; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected function updateTimestamps(array $values) |
| 75 | 75 | { |
| 76 | - if (! $this->model->usesTimestamps() || |
|
| 76 | + if (!$this->model->usesTimestamps() || |
|
| 77 | 77 | is_null($this->model->getUpdatedAtColumn()) || |
| 78 | 78 | is_null($this->model->getCreatedAtColumn())) { |
| 79 | 79 | return $values; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $updatedAtColumn = $this->model->getUpdatedAtColumn(); |
| 83 | 83 | $createdAtColumn = $this->model->getCreatedAtColumn(); |
| 84 | 84 | $timestamps[$updatedAtColumn] = $timestamp; |
| 85 | - if (! isset($values[$createdAtColumn]) && $this->model->$createdAtColumn == '') { |
|
| 85 | + if (!isset($values[$createdAtColumn]) && $this->model->$createdAtColumn == '') { |
|
| 86 | 86 | $timestamps[$createdAtColumn] = $timestamp; |
| 87 | 87 | } |
| 88 | 88 | $values = array_merge( |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->connection = $connection; |
| 52 | 52 | $this->grammar = $grammar ?: $connection->getQueryGrammar(); |
| 53 | 53 | $this->processor = $processor ?: $connection->getPostProcessor(); |
| 54 | - if (! $aqb instanceof QueryBuilder) { |
|
| 54 | + if (!$aqb instanceof QueryBuilder) { |
|
| 55 | 55 | $aqb = new QueryBuilder(); |
| 56 | 56 | } |
| 57 | 57 | $this->aqb = $aqb; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function get($columns = ['*']) |
| 120 | 120 | { |
| 121 | - $results = collect($this->onceWithColumns(Arr::wrap($columns), function () { |
|
| 121 | + $results = collect($this->onceWithColumns(Arr::wrap($columns), function() { |
|
| 122 | 122 | return $this->runSelect(); |
| 123 | 123 | })); |
| 124 | 124 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $results = $this->cloneWithout($this->unions ? [] : ['columns']) |
| 176 | 176 | ->setAggregate($function, $columns) |
| 177 | 177 | ->get($columns); |
| 178 | - if (! $results->isEmpty()) { |
|
| 178 | + if (!$results->isEmpty()) { |
|
| 179 | 179 | return $results[0]; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function compileInsert(Builder $builder, array $values) |
| 98 | 98 | { |
| 99 | - if (! is_array(reset($values))) { |
|
| 99 | + if (!is_array(reset($values))) { |
|
| 100 | 100 | $values = [$values]; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | // see if that component exists. If it does we'll just call the compiler |
| 171 | 171 | // function for the component which is responsible for making the SQL. |
| 172 | 172 | |
| 173 | - if (isset($builder->$component) && ! is_null($builder->$component)) { |
|
| 173 | + if (isset($builder->$component) && !is_null($builder->$component)) { |
|
| 174 | 174 | $method = 'compile'.ucfirst($component); |
| 175 | 175 | |
| 176 | 176 | $builder = $this->$method($builder, $builder->$component); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | protected function compileWheresToArray($builder) |
| 232 | 232 | { |
| 233 | - $result = collect($builder->wheres)->map(function ($where) use ($builder) { |
|
| 233 | + $result = collect($builder->wheres)->map(function($where) use ($builder) { |
|
| 234 | 234 | // ArangoDB uses a double '=' for comparison |
| 235 | 235 | if ($where['operator'] == '=') { |
| 236 | 236 | $where['operator'] = '=='; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | protected function compileOrders(Builder $builder, $orders) |
| 353 | 353 | { |
| 354 | - if (! empty($orders)) { |
|
| 354 | + if (!empty($orders)) { |
|
| 355 | 355 | $builder->aqb = $builder->aqb->sort($this->compileOrdersToArray($builder, $orders)); |
| 356 | 356 | |
| 357 | 357 | return $builder; |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | protected function compileOrdersToArray(Builder $builder, $orders) |
| 371 | 371 | { |
| 372 | - return array_map(function ($order) { |
|
| 372 | + return array_map(function($order) { |
|
| 373 | 373 | return $order['sql'] ?? $this->prefixTable($order['column']).' '.$order['direction']; |
| 374 | 374 | }, $orders); |
| 375 | 375 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | $builder = $this->generateTableAlias($builder, $table); |
| 480 | 480 | $tableAlias = $builder->getAlias($table); |
| 481 | 481 | |
| 482 | - if (! is_null($_key)) { |
|
| 482 | + if (!is_null($_key)) { |
|
| 483 | 483 | $builder->aqb = $builder->aqb->remove((string) $_key, $table)->get(); |
| 484 | 484 | |
| 485 | 485 | return $builder; |