@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function cursor($query, $bindings = [], $useReadPdo = null, $transactionCollections = null) |
157 | 157 | { |
158 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
158 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
159 | 159 | if ($this->pretending()) { |
160 | 160 | return []; |
161 | 161 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function statement($query, $bindings = [], $transactionCollections = null) |
184 | 184 | { |
185 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
185 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
186 | 186 | if ($this->pretending()) { |
187 | 187 | return true; |
188 | 188 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function affectingStatement($query, $bindings = [], $transactionCollections = null) |
215 | 215 | { |
216 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
216 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
217 | 217 | if ($this->pretending()) { |
218 | 218 | return 0; |
219 | 219 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function unprepared($query) |
250 | 250 | { |
251 | - return $this->run($query, [], function ($query) { |
|
251 | + return $this->run($query, [], function($query) { |
|
252 | 252 | if ($this->pretending()) { |
253 | 253 | return true; |
254 | 254 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | */ |
299 | 299 | public function select($query, $bindings = [], $useReadPdo = true, $transactionCollections = null) |
300 | 300 | { |
301 | - return $this->run($query, $bindings, function ($query, $bindings) { |
|
301 | + return $this->run($query, $bindings, function($query, $bindings) { |
|
302 | 302 | if ($this->pretending()) { |
303 | 303 | return []; |
304 | 304 | } |
@@ -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 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | protected function registerRepository() |
55 | 55 | { |
56 | - $this->app->singleton('migration.repository', function ($app) { |
|
56 | + $this->app->singleton('migration.repository', function($app) { |
|
57 | 57 | $collection = $app['config']['database.migrations']; |
58 | 58 | |
59 | 59 | return new DatabaseMigrationRepository($app['db'], $collection); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function registerCreator() |
64 | 64 | { |
65 | - $this->app->singleton('migration.creator', function ($app) { |
|
65 | + $this->app->singleton('migration.creator', function($app) { |
|
66 | 66 | return new MigrationCreator($app['files']); |
67 | 67 | }); |
68 | 68 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function registerMigrateMakeCommand() |
94 | 94 | { |
95 | - $this->app->singleton('command.migrate.make', function ($app) { |
|
95 | + $this->app->singleton('command.migrate.make', function($app) { |
|
96 | 96 | // Once we have the migration creator registered, we will create the command |
97 | 97 | // and inject the creator. The creator is responsible for the actual file |
98 | 98 | // creation of the migrations, and may be extended by these developers. |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | protected function registerAranguentConvertMigrationsCommand() |
108 | 108 | { |
109 | - $this->app->singleton('command.aranguent.convert-migrations', function ($app) { |
|
109 | + $this->app->singleton('command.aranguent.convert-migrations', function($app) { |
|
110 | 110 | return new AranguentConvertMigrationsCommand($app['migrator']); |
111 | 111 | }); |
112 | 112 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $this->prefix = $prefix; |
104 | 104 | |
105 | - if (! is_null($callback)) { |
|
105 | + if (!is_null($callback)) { |
|
106 | 106 | $callback($this); |
107 | 107 | } |
108 | 108 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | protected function creating() |
246 | 246 | { |
247 | - return collect($this->commands)->contains(function ($command) { |
|
247 | + return collect($this->commands)->contains(function($command) { |
|
248 | 248 | return $command->name === 'create'; |
249 | 249 | }); |
250 | 250 | } |
@@ -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 |