@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $filter = []; |
| 36 | 36 | foreach ($command->attribute as $attribute) { |
| 37 | - $filter[] = ['doc.' . $attribute, '!=', null]; |
|
| 37 | + $filter[] = ['doc.'.$attribute, '!=', null]; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $aqb = (new QueryBuilder())->for('doc', $collection) |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | public function compileRenameAttribute($collection, Fluent $command) |
| 60 | 60 | { |
| 61 | 61 | $filter = [ |
| 62 | - ['doc.' . $command->from, '!=', null], |
|
| 63 | - ['doc.' . $command->to, '==', null], |
|
| 62 | + ['doc.'.$command->from, '!=', null], |
|
| 63 | + ['doc.'.$command->to, '==', null], |
|
| 64 | 64 | ]; |
| 65 | 65 | |
| 66 | 66 | $aqb = (new QueryBuilder())->for('doc', $collection) |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | 'doc', |
| 70 | 70 | [ |
| 71 | 71 | $command->from => null, |
| 72 | - $command->to => 'doc.' . $command->from, |
|
| 72 | + $command->to => 'doc.'.$command->from, |
|
| 73 | 73 | ], |
| 74 | 74 | $collection |
| 75 | 75 | ) |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $data = []; |
| 100 | 100 | foreach ($command->attributes as $attribute) { |
| 101 | - $filter[] = ['doc.' . $attribute, '!=', null, 'OR']; |
|
| 101 | + $filter[] = ['doc.'.$attribute, '!=', null, 'OR']; |
|
| 102 | 102 | $data[$attribute] = null; |
| 103 | 103 | } |
| 104 | 104 | $aqb = (new QueryBuilder())->for('doc', $collection) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function compileAqlCommand($command) |
| 150 | 150 | { |
| 151 | - $compileMethod = 'compile' . ucfirst($command->name); |
|
| 151 | + $compileMethod = 'compile'.ucfirst($command->name); |
|
| 152 | 152 | if (method_exists($this->grammar, $compileMethod)) { |
| 153 | 153 | return $this->grammar->$compileMethod($this->table, $command); |
| 154 | 154 | } |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function executeCommand($command) |
| 163 | 163 | { |
| 164 | - $executeNamedMethod = 'execute' . ucfirst($command->name) . 'Command'; |
|
| 165 | - $executeHandlerMethod = 'execute' . ucfirst($command->handler) . 'Command'; |
|
| 164 | + $executeNamedMethod = 'execute'.ucfirst($command->name).'Command'; |
|
| 165 | + $executeHandlerMethod = 'execute'.ucfirst($command->handler).'Command'; |
|
| 166 | 166 | if (method_exists($this, $executeNamedMethod)) { |
| 167 | 167 | $this->$executeNamedMethod($command); |
| 168 | 168 | } elseif (method_exists($this, $executeHandlerMethod)) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function executeCollectionCommand($command) |
| 184 | 184 | { |
| 185 | 185 | if ($this->connection->pretending()) { |
| 186 | - $this->connection->logQuery('/* ' . $command->explanation . " */\n", []); |
|
| 186 | + $this->connection->logQuery('/* '.$command->explanation." */\n", []); |
|
| 187 | 187 | |
| 188 | 188 | return; |
| 189 | 189 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function executeIgnoreCommand($command) |
| 204 | 204 | { |
| 205 | 205 | if ($this->connection->pretending()) { |
| 206 | - $this->connection->logQuery('/* ' . $command->explanation . " */\n", []); |
|
| 206 | + $this->connection->logQuery('/* '.$command->explanation." */\n", []); |
|
| 207 | 207 | |
| 208 | 208 | return; |
| 209 | 209 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if (is_string($as) && $this->isQueryable($column)) { |
| 128 | 128 | $this->selectSub($column, $as); |
| 129 | 129 | } |
| 130 | - if (! is_string($as) || ! $this->isQueryable($column)) { |
|
| 130 | + if (!is_string($as) || !$this->isQueryable($column)) { |
|
| 131 | 131 | $this->columns[$as] = $column; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function get($columns = ['*']) |
| 191 | 191 | { |
| 192 | - return collect($this->onceWithColumns(Arr::wrap($columns), function () { |
|
| 192 | + return collect($this->onceWithColumns(Arr::wrap($columns), function() { |
|
| 193 | 193 | return $this->runSelect(); |
| 194 | 194 | })); |
| 195 | 195 | } |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | $this->joins[] = $join; |
| 388 | 388 | } |
| 389 | - if (! $first instanceof Closure) { |
|
| 389 | + if (!$first instanceof Closure) { |
|
| 390 | 390 | // If the column is simply a string, we can assume the join simply has a basic |
| 391 | 391 | // "on" clause with a single condition. So we will just build the join with |
| 392 | 392 | // this simple join clauses attached to it. There is not a join callback. |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | //fixme: Remove binding when implementing subqueries |
| 419 | 419 | $bindings = null; |
| 420 | 420 | |
| 421 | - $column = new Expression('(' . $query . ')'); |
|
| 421 | + $column = new Expression('('.$query.')'); |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | protected function compileAggregate(Builder $builder, $aggregate) |
| 18 | 18 | { |
| 19 | - $method = 'compile' . ucfirst($aggregate['function']); |
|
| 19 | + $method = 'compile'.ucfirst($aggregate['function']); |
|
| 20 | 20 | |
| 21 | 21 | return $this->$method($builder, $aggregate); |
| 22 | 22 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if (isset($results[1])) { |
| 59 | 59 | $results[1] = trim($results[1], '`'); |
| 60 | 60 | } |
| 61 | - if (! isset($results[1])) { |
|
| 61 | + if (!isset($results[1])) { |
|
| 62 | 62 | $results[1] = $results[0]; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected function generateTableAlias($table, $postfix = 'Doc') |
| 75 | 75 | { |
| 76 | - return Str::singular($table) . $postfix; |
|
| 76 | + return Str::singular($table).$postfix; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | protected function replaceTableForAlias($reference): string |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | $alias = $this->getTableAlias($target); |
| 101 | 101 | |
| 102 | - if (Str::startsWith($value, $alias . '.')) { |
|
| 102 | + if (Str::startsWith($value, $alias.'.')) { |
|
| 103 | 103 | return $value; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - return $alias . '.' . $value; |
|
| 106 | + return $alias.'.'.$value; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $references[0] = $tableAlias; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if ($tableAlias === null && ! $this->isTableAlias($references[0])) { |
|
| 165 | + if ($tableAlias === null && !$this->isTableAlias($references[0])) { |
|
| 166 | 166 | $tableAlias = $this->generateTableAlias($table); |
| 167 | 167 | array_unshift($references, $tableAlias); |
| 168 | 168 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | protected function compileWheresToArray($query) |
| 40 | 40 | { |
| 41 | - return collect($query->wheres)->map(function ($where) use ($query) { |
|
| 41 | + return collect($query->wheres)->map(function($where) use ($query) { |
|
| 42 | 42 | return $this->{"where{$where['type']}"}($query, $where); |
| 43 | 43 | })->all(); |
| 44 | 44 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (isset($where['operator'])) { |
| 81 | 81 | $where['operator'] = $this->translateOperator($where['operator']); |
| 82 | 82 | } |
| 83 | - if (! isset($where['operator'])) { |
|
| 83 | + if (!isset($where['operator'])) { |
|
| 84 | 84 | $where['operator'] = $this->getOperatorByWhereType($where['type']); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $predicate[0] = $this->normalizeColumn($query, $where['column']); |
| 299 | 299 | $predicate[1] = 'IN'; |
| 300 | - $predicate[2] = '[' . implode(', ', $where['values']) . ']'; |
|
| 300 | + $predicate[2] = '['.implode(', ', $where['values']).']'; |
|
| 301 | 301 | $predicate[3] = $where['boolean']; |
| 302 | 302 | |
| 303 | 303 | return $predicate; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | $predicate[0] = $this->normalizeColumn($query, $where['column']); |
| 339 | 339 | $predicate[1] = 'NOT IN'; |
| 340 | - $predicate[2] = '[' . implode(', ', $where['values']) . ']'; |
|
| 340 | + $predicate[2] = '['.implode(', ', $where['values']).']'; |
|
| 341 | 341 | $predicate[3] = $where['boolean']; |
| 342 | 342 | return $predicate; |
| 343 | 343 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | protected function compileJoins(Builder $builder, $joins) |
| 19 | 19 | { |
| 20 | 20 | foreach ($joins as $join) { |
| 21 | - $compileMethod = 'compile' . ucfirst($join->type) . 'Join'; |
|
| 21 | + $compileMethod = 'compile'.ucfirst($join->type).'Join'; |
|
| 22 | 22 | $builder = $this->$compileMethod($builder, $join); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | protected function prefixTable($table) |
| 97 | 97 | { |
| 98 | - return $this->tablePrefix . $table; |
|
| 98 | + return $this->tablePrefix.$table; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // function for the component which is responsible for making the SQL. |
| 189 | 189 | |
| 190 | 190 | if (isset($builder->$component) && !is_null($builder->$component)) { |
| 191 | - $method = 'compile' . ucfirst($component); |
|
| 191 | + $method = 'compile'.ucfirst($component); |
|
| 192 | 192 | |
| 193 | 193 | $builder = $this->$method($builder, $builder->$component); |
| 194 | 194 | } |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | // Prepare columns |
| 318 | 318 | foreach ($columns as $column) { |
| 319 | 319 | // Extract rows |
| 320 | - if (substr($column, strlen($column) - 2) === '.*') { |
|
| 320 | + if (substr($column, strlen($column) - 2) === '.*') { |
|
| 321 | 321 | $table = substr($column, 0, strlen($column) - 2); |
| 322 | 322 | $returnDocs[] = $this->getTableAlias($table); |
| 323 | 323 | |
@@ -340,15 +340,15 @@ discard block |
||
| 340 | 340 | { |
| 341 | 341 | $values = []; |
| 342 | 342 | |
| 343 | - if (! empty($returnAttributes)) { |
|
| 343 | + if (!empty($returnAttributes)) { |
|
| 344 | 344 | $values = $returnAttributes; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if (! empty($returnAttributes) && ! empty($returnDocs)) { |
|
| 347 | + if (!empty($returnAttributes) && !empty($returnDocs)) { |
|
| 348 | 348 | $returnDocs[] = $returnAttributes; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if (! empty($returnDocs)) { |
|
| 351 | + if (!empty($returnDocs)) { |
|
| 352 | 352 | $values = $builder->aqb->merge(...$returnDocs); |
| 353 | 353 | } |
| 354 | 354 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $this->beginTransaction(); |
| 32 | 32 | |
| 33 | - return tap($callback($this), function () use ($options, $attempts) { |
|
| 33 | + return tap($callback($this), function() use ($options, $attempts) { |
|
| 34 | 34 | $this->commit($options, $attempts); |
| 35 | 35 | }); |
| 36 | 36 | } |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // $query = addslashes($query); |
| 84 | - $jsCommand = 'db._query(aql`' . $query . '`'; |
|
| 84 | + $jsCommand = 'db._query(aql`'.$query.'`'; |
|
| 85 | 85 | if (!empty($bindings)) { |
| 86 | 86 | $bindings = json_encode($bindings); |
| 87 | - $jsCommand .= ', ' . $bindings; |
|
| 87 | + $jsCommand .= ', '.$bindings; |
|
| 88 | 88 | } |
| 89 | 89 | $jsCommand .= ');'; |
| 90 | 90 | $command = new IlluminateFluent([ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | if (isset($collections['read'])) { |
| 166 | 166 | $collections['read'] = array_merge($collections['read'], $extractedCollections); |
| 167 | 167 | } |
| 168 | - if (! isset($collections['read'])) { |
|
| 168 | + if (!isset($collections['read'])) { |
|
| 169 | 169 | $collections['read'] = $extractedCollections; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | if (isset($collections['write'])) { |
| 199 | 199 | $collections['write'] = array_merge($collections['write'], $extractedCollections); |
| 200 | 200 | } |
| 201 | - if (! isset($collections['write'])) { |
|
| 201 | + if (!isset($collections['write'])) { |
|
| 202 | 202 | $collections['write'] = $extractedCollections; |
| 203 | 203 | } |
| 204 | 204 | |