@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | public function register() |
38 | 38 | { |
39 | 39 | // Add database driver. |
40 | - $this->app->resolving('db', function ($db) { |
|
41 | - $db->extend('arangodb', function ($config, $name) { |
|
40 | + $this->app->resolving('db', function($db) { |
|
41 | + $db->extend('arangodb', function($config, $name) { |
|
42 | 42 | $config['name'] = $name; |
43 | 43 | $connection = new Connection($config); |
44 | 44 | $connection->setSchemaGrammar(new SchemaGrammar); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | }); |
48 | 48 | }); |
49 | 49 | |
50 | - $this->app->resolving(function ($app) { |
|
50 | + $this->app->resolving(function($app) { |
|
51 | 51 | if (class_exists('Illuminate\Foundation\AliasLoader')) { |
52 | 52 | $loader = \Illuminate\Foundation\AliasLoader::getInstance(); |
53 | 53 | $loader->alias('Eloquent', 'LaravelFreelancerNL\Aranguent\Eloquent\Model'); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | // Here we will replace the table place-holders with the table specified by |
69 | 69 | // the developer, which is useful for quickly creating a tables creation |
70 | 70 | // or update migration from the console instead of typing it manually. |
71 | - if (! is_null($collection)) { |
|
71 | + if (!is_null($collection)) { |
|
72 | 72 | $stub = str_replace('DummyCollection', $collection, $stub); |
73 | 73 | } |
74 | 74 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function create($collection, Closure $callback, $config = []) |
58 | 58 | { |
59 | - $this->build(tap($this->createBlueprint($collection), function ($blueprint) use ($callback, $config) { |
|
59 | + $this->build(tap($this->createBlueprint($collection), function($blueprint) use ($callback, $config) { |
|
60 | 60 | $blueprint->create($config); |
61 | 61 | |
62 | 62 | $callback($blueprint); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | protected function getAllCollections(array $options = []) |
172 | 172 | { |
173 | - if (! isset($options['excludeSystem'])) { |
|
173 | + if (!isset($options['excludeSystem'])) { |
|
174 | 174 | $options['excludeSystem'] = true; |
175 | 175 | } |
176 | 176 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $this->beginTransaction(); |
31 | 31 | |
32 | - return tap($callback($this), function () use ($options, $attempts) { |
|
32 | + return tap($callback($this), function() use ($options, $attempts) { |
|
33 | 33 | $this->commit($options, $attempts); |
34 | 34 | }); |
35 | 35 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | // $query = addslashes($query); |
82 | 82 | $jsCommand = 'db._query(aql`'.$query.'`'; |
83 | - if (! empty($bindings)) { |
|
83 | + if (!empty($bindings)) { |
|
84 | 84 | $bindings = json_encode($bindings); |
85 | 85 | $jsCommand .= ', '.$bindings; |
86 | 86 | } |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function commit($options = [], $attempts = 1) |
211 | 211 | { |
212 | - if (! $this->transactions > 0) { |
|
212 | + if (!$this->transactions > 0) { |
|
213 | 213 | throw new \Exception('Transaction committed before starting one.'); |
214 | 214 | } |
215 | - if (! isset($this->transactionCommands[$this->transactions]) || empty($this->transactionCommands[$this->transactions])) { |
|
215 | + if (!isset($this->transactionCommands[$this->transactions]) || empty($this->transactionCommands[$this->transactions])) { |
|
216 | 216 | throw new \Exception('Cannot commit an empty transaction.'); |
217 | 217 | } |
218 | 218 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $name = Str::snake(trim($this->input->getArgument('name'))); |
49 | 49 | |
50 | 50 | $collection = $this->input->getOption('collection'); |
51 | - if (! $collection) { |
|
51 | + if (!$collection) { |
|
52 | 52 | $collection = $this->input->getOption('table'); |
53 | 53 | } |
54 | 54 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // If no table was given as an option but a create option is given then we |
58 | 58 | // will use the "create" option as the table name. This allows the devs |
59 | 59 | // to pass a table name into this option as a short-cut for creating. |
60 | - if (! $collection && is_string($create)) { |
|
60 | + if (!$collection && is_string($create)) { |
|
61 | 61 | $collection = $create; |
62 | 62 | |
63 | 63 | $create = true; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // Next, we will attempt to guess the table name if this the migration has |
67 | 67 | // "create" in the name. This will allow us to provide a convenient way |
68 | 68 | // of creating migrations that create new tables for the application. |
69 | - if (! $collection) { |
|
69 | + if (!$collection) { |
|
70 | 70 | [$collection, $create] = TableGuesser::guess($name); |
71 | 71 | } |
72 | 72 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function handle() |
54 | 54 | { |
55 | - if (! $this->confirmToProceed()) { |
|
55 | + if (!$this->confirmToProceed()) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function getRan() |
50 | 50 | { |
51 | - $qb = AQB::for('m', 'migrations') |
|
51 | + $qb = AQB::for ('m', 'migrations') |
|
52 | 52 | ->sort(['m.batch', 'm.migrations']) |
53 | 53 | ->return('m.migration') |
54 | 54 | ->get(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $bindings['steps'] = $steps; |
74 | 74 | |
75 | - $qb = AQB::for('m', 'migrations') |
|
75 | + $qb = AQB::for ('m', 'migrations') |
|
76 | 76 | ->filter('m.batch', '>=', 1) |
77 | 77 | ->sort([['m.batch', 'DESC'], ['m.migration', 'DESC']]) |
78 | 78 | ->limit($steps) |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | $batch = $this->getLastBatchNumber(); |
89 | 89 | |
90 | - $qb = AQB::for('m', 'migrations') |
|
90 | + $qb = AQB::for ('m', 'migrations') |
|
91 | 91 | ->filter('m.batch', $batch) |
92 | 92 | ->sort('m.migration', 'desc') |
93 | 93 | ->return('m') |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getMigrationBatches() |
109 | 109 | { |
110 | - $qb = AQB::for('m', 'migrations') |
|
110 | + $qb = AQB::for ('m', 'migrations') |
|
111 | 111 | ->sort([['m.batch'], ['m.migration']]) |
112 | 112 | ->return(['batch' => 'm.batch', 'migration' => 'm.migration']) |
113 | 113 | ->get(); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function delete($migration) |
147 | 147 | { |
148 | - $qb = AQB::for('m', 'migrations') |
|
148 | + $qb = AQB::for ('m', 'migrations') |
|
149 | 149 | ->filter('m.migration', $migration->migration) |
150 | 150 | ->remove('m', 'migrations') |
151 | 151 | ->get(); |
@@ -48,10 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function getRan() |
50 | 50 | { |
51 | - $qb = AQB::for('m', 'migrations') |
|
52 | - ->sort(['m.batch', 'm.migrations']) |
|
51 | + $qb = AQB::for('m', 'migrations') { |
|
52 | + ->sort(['m.batch', 'm.migrations']) |
|
53 | 53 | ->return('m.migration') |
54 | 54 | ->get(); |
55 | + } |
|
55 | 56 | |
56 | 57 | |
57 | 58 | return $this->getConnection()->select($qb->query); |
@@ -72,12 +73,13 @@ discard block |
||
72 | 73 | { |
73 | 74 | $bindings['steps'] = $steps; |
74 | 75 | |
75 | - $qb = AQB::for('m', 'migrations') |
|
76 | - ->filter('m.batch', '>=', 1) |
|
76 | + $qb = AQB::for('m', 'migrations') { |
|
77 | + ->filter('m.batch', '>=', 1) |
|
77 | 78 | ->sort([['m.batch', 'DESC'], ['m.migration', 'DESC']]) |
78 | 79 | ->limit($steps) |
79 | 80 | ->return(['migration' => 'm.migration', 'batch' => 'm.batch']) |
80 | 81 | ->get(); |
82 | + } |
|
81 | 83 | |
82 | 84 | return $this->getConnection()->select($qb->query); |
83 | 85 | |
@@ -87,11 +89,12 @@ discard block |
||
87 | 89 | { |
88 | 90 | $batch = $this->getLastBatchNumber(); |
89 | 91 | |
90 | - $qb = AQB::for('m', 'migrations') |
|
91 | - ->filter('m.batch', $batch) |
|
92 | + $qb = AQB::for('m', 'migrations') { |
|
93 | + ->filter('m.batch', $batch) |
|
92 | 94 | ->sort('m.migration', 'desc') |
93 | 95 | ->return('m') |
94 | 96 | ->get(); |
97 | + } |
|
95 | 98 | |
96 | 99 | return $this->getConnection()->select($qb->query); |
97 | 100 | |
@@ -107,10 +110,11 @@ discard block |
||
107 | 110 | */ |
108 | 111 | public function getMigrationBatches() |
109 | 112 | { |
110 | - $qb = AQB::for('m', 'migrations') |
|
111 | - ->sort([['m.batch'], ['m.migration']]) |
|
113 | + $qb = AQB::for('m', 'migrations') { |
|
114 | + ->sort([['m.batch'], ['m.migration']]) |
|
112 | 115 | ->return(['batch' => 'm.batch', 'migration' => 'm.migration']) |
113 | 116 | ->get(); |
117 | + } |
|
114 | 118 | |
115 | 119 | return $this->getConnection()->select($qb->query); |
116 | 120 | |
@@ -145,10 +149,11 @@ discard block |
||
145 | 149 | */ |
146 | 150 | public function delete($migration) |
147 | 151 | { |
148 | - $qb = AQB::for('m', 'migrations') |
|
149 | - ->filter('m.migration', $migration->migration) |
|
152 | + $qb = AQB::for('m', 'migrations') { |
|
153 | + ->filter('m.migration', $migration->migration) |
|
150 | 154 | ->remove('m', 'migrations') |
151 | 155 | ->get(); |
156 | + } |
|
152 | 157 | |
153 | 158 | $this->getConnection()->delete($qb->query, $qb->binds); |
154 | 159 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
36 | 36 | } |
37 | 37 | |
38 | - $qb = AQB::for('doc', $collection) |
|
38 | + $qb = 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 | - $qb = AQB::for('doc', $collection) |
|
68 | + $qb = AQB::for ('doc', $collection) |
|
69 | 69 | ->filter($filter) |
70 | 70 | ->update( |
71 | 71 | 'doc', |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $command->to => 'doc.'.$command->from, |
75 | 75 | ], |
76 | 76 | $collection) |
77 | - ->options( ['keepNull' => true]) |
|
77 | + ->options(['keepNull' => true]) |
|
78 | 78 | ->get(); |
79 | 79 | |
80 | 80 | $command->aqb = $qb; |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
102 | 102 | $data[$attribute] = 'null'; |
103 | 103 | } |
104 | - $qb = AQB::for('doc', $collection) |
|
105 | - ->filter($filter ) |
|
104 | + $qb = AQB::for ('doc', $collection) |
|
105 | + ->filter($filter) |
|
106 | 106 | ->update('doc', $data, $collection) |
107 | 107 | ->options(['keepNull' => false]) |
108 | 108 | ->get(); |
@@ -35,11 +35,12 @@ discard block |
||
35 | 35 | $filter[] = ['doc.'.$attribute, '!=', 'null']; |
36 | 36 | } |
37 | 37 | |
38 | - $qb = AQB::for('doc', $collection) |
|
39 | - ->filter($filter) |
|
38 | + $qb = 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 = $qb; |
45 | 46 | |
@@ -65,8 +66,8 @@ discard block |
||
65 | 66 | ['doc.'.$command->to], |
66 | 67 | ]; |
67 | 68 | |
68 | - $qb = AQB::for('doc', $collection) |
|
69 | - ->filter($filter) |
|
69 | + $qb = 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 = $qb; |
81 | 83 | |
@@ -101,11 +103,12 @@ discard block |
||
101 | 103 | $filter[] = ['doc.'.$attribute, '!=', 'null', 'OR']; |
102 | 104 | $data[$attribute] = 'null'; |
103 | 105 | } |
104 | - $qb = AQB::for('doc', $collection) |
|
105 | - ->filter($filter ) |
|
106 | + $qb = 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 = $qb; |
111 | 114 |
@@ -100,7 +100,7 @@ |
||
100 | 100 | // If an ID is passed to the method, we will set the where clause to check the |
101 | 101 | // ID to let developers to simply and quickly remove a single row from this |
102 | 102 | // database without manually specifying the "where" clauses on the query. |
103 | - if (! is_null($_key)) { |
|
103 | + if (!is_null($_key)) { |
|
104 | 104 | $this->where($this->from.'._key', '=', $_key); |
105 | 105 | } |
106 | 106 | $aqb = $this->grammar->compileDelete($this, $_key); |