@@ -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 |
@@ -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(); |
@@ -47,10 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function getRan() |
49 | 49 | { |
50 | - $qb = AQB::for('m', 'migrations') |
|
51 | - ->sort(['m.batch', 'm.migrations']) |
|
50 | + $qb = AQB::for('m', 'migrations') { |
|
51 | + ->sort(['m.batch', 'm.migrations']) |
|
52 | 52 | ->return('m.migration') |
53 | 53 | ->get(); |
54 | + } |
|
54 | 55 | |
55 | 56 | return $this->getConnection()->select($qb->query); |
56 | 57 | |
@@ -70,12 +71,13 @@ discard block |
||
70 | 71 | { |
71 | 72 | $bindings['steps'] = $steps; |
72 | 73 | |
73 | - $qb = AQB::for('m', 'migrations') |
|
74 | - ->filter('m.batch', '>=', 1) |
|
74 | + $qb = AQB::for('m', 'migrations') { |
|
75 | + ->filter('m.batch', '>=', 1) |
|
75 | 76 | ->sort([['m.batch', 'DESC'], ['m.migration', 'DESC']]) |
76 | 77 | ->limit($steps) |
77 | 78 | ->return(['migration' => 'm.migration', 'batch' => 'm.batch']) |
78 | 79 | ->get(); |
80 | + } |
|
79 | 81 | |
80 | 82 | return $this->getConnection()->select($qb->query); |
81 | 83 | } |
@@ -84,11 +86,12 @@ discard block |
||
84 | 86 | { |
85 | 87 | $batch = $this->getLastBatchNumber(); |
86 | 88 | |
87 | - $qb = AQB::for('m', 'migrations') |
|
88 | - ->filter('m.batch', $batch) |
|
89 | + $qb = AQB::for('m', 'migrations') { |
|
90 | + ->filter('m.batch', $batch) |
|
89 | 91 | ->sort('m.migration', 'desc') |
90 | 92 | ->return('m') |
91 | 93 | ->get(); |
94 | + } |
|
92 | 95 | |
93 | 96 | return $this->getConnection()->select($qb->query); |
94 | 97 | |
@@ -104,10 +107,11 @@ discard block |
||
104 | 107 | */ |
105 | 108 | public function getMigrationBatches() |
106 | 109 | { |
107 | - $qb = AQB::for('m', 'migrations') |
|
108 | - ->sort([['m.batch'], ['m.migration']]) |
|
110 | + $qb = AQB::for('m', 'migrations') { |
|
111 | + ->sort([['m.batch'], ['m.migration']]) |
|
109 | 112 | ->return(['batch' => 'm.batch', 'migration' => 'm.migration']) |
110 | 113 | ->get(); |
114 | + } |
|
111 | 115 | |
112 | 116 | return $this->getConnection()->select($qb->query); |
113 | 117 | |
@@ -142,10 +146,11 @@ discard block |
||
142 | 146 | */ |
143 | 147 | public function delete($migration) |
144 | 148 | { |
145 | - $qb = AQB::for('m', 'migrations') |
|
146 | - ->filter('m.migration', $migration->migration) |
|
149 | + $qb = AQB::for('m', 'migrations') { |
|
150 | + ->filter('m.migration', $migration->migration) |
|
147 | 151 | ->remove('m', 'migrations') |
148 | 152 | ->get(); |
153 | + } |
|
149 | 154 | |
150 | 155 | $this->getConnection()->delete($qb->query, $qb->binds); |
151 | 156 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | protected function registerRepository() |
58 | 58 | { |
59 | - $this->app->singleton('migration.repository', function ($app) { |
|
59 | + $this->app->singleton('migration.repository', function($app) { |
|
60 | 60 | $collection = $app['config']['database.migrations']; |
61 | 61 | |
62 | 62 | return new DatabaseMigrationRepository($app['db'], $collection); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | protected function registerCreator() |
67 | 67 | { |
68 | - $this->app->singleton('migration.creator', function ($app) { |
|
68 | + $this->app->singleton('migration.creator', function($app) { |
|
69 | 69 | return new MigrationCreator($app['files']); |
70 | 70 | }); |
71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | protected function registerMigrateMakeCommand() |
79 | 79 | { |
80 | - $this->app->singleton('command.migrate.make', function ($app) { |
|
80 | + $this->app->singleton('command.migrate.make', function($app) { |
|
81 | 81 | $creator = $app['migration.creator']; |
82 | 82 | |
83 | 83 | $composer = $app['composer']; |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function registerAranguentConvertMigrationsCommand() |
90 | 90 | { |
91 | - $this->app->singleton('command.aranguent.convert-migrations', function ($app) { |
|
91 | + $this->app->singleton('command.aranguent.convert-migrations', function($app) { |
|
92 | 92 | return new AranguentConvertMigrationsCommand($app['migrator']); |
93 | 93 | }); |
94 | 94 | } |
95 | 95 | |
96 | 96 | protected function registerMakeModelCommand() |
97 | 97 | { |
98 | - $this->app->singleton('command.model.aranguent', function ($app) { |
|
98 | + $this->app->singleton('command.model.aranguent', function($app) { |
|
99 | 99 | return new ModelAranguentCommand($app['files']); |
100 | 100 | }); |
101 | 101 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function cursor($query, $bindings = [], $useReadPdo = null, $transactionCollections = null) |
156 | 156 | { |
157 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
157 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
158 | 158 | if ($this->pretending()) { |
159 | 159 | return []; |
160 | 160 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $query = $query->query; |
187 | 187 | } |
188 | 188 | |
189 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
189 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
190 | 190 | if ($this->pretending()) { |
191 | 191 | return true; |
192 | 192 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $query = $query->query; |
224 | 224 | } |
225 | 225 | |
226 | - return $this->run($query, $bindings, function ($query, $bindings) use ($transactionCollections) { |
|
226 | + return $this->run($query, $bindings, function($query, $bindings) use ($transactionCollections) { |
|
227 | 227 | if ($this->pretending()) { |
228 | 228 | return 0; |
229 | 229 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | */ |
259 | 259 | public function unprepared($query) |
260 | 260 | { |
261 | - return $this->run($query, [], function ($query) { |
|
261 | + return $this->run($query, [], function($query) { |
|
262 | 262 | if ($this->pretending()) { |
263 | 263 | return true; |
264 | 264 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $query = $query->query; |
329 | 329 | } |
330 | 330 | |
331 | - return $this->run($query, $bindings, function ($query, $bindings, $transactionCollections = null) { |
|
331 | + return $this->run($query, $bindings, function($query, $bindings, $transactionCollections = null) { |
|
332 | 332 | if ($this->pretending()) { |
333 | 333 | return []; |
334 | 334 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | |
453 | 453 | public function getCollectionHandler() |
454 | 454 | { |
455 | - if (! isset($this->collectionHandler)) { |
|
455 | + if (!isset($this->collectionHandler)) { |
|
456 | 456 | $this->collectionHandler = new ArangoCollectionHandler($this->arangoConnection); |
457 | 457 | $this->collectionHandler->setDocumentClass(Document::class); |
458 | 458 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | public function getDocumentHandler() |
464 | 464 | { |
465 | - if (! isset($this->documentHandler)) { |
|
465 | + if (!isset($this->documentHandler)) { |
|
466 | 466 | $this->documentHandler = new ArangoDocumentHandler($this->arangoConnection); |
467 | 467 | $this->documentHandler->setDocumentClass(Document::class); |
468 | 468 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | |
473 | 473 | public function getUserHandler() |
474 | 474 | { |
475 | - if (! isset($this->userHandler)) { |
|
475 | + if (!isset($this->userHandler)) { |
|
476 | 476 | $this->userHandler = new ArangoUserHandler($this->arangoConnection); |
477 | 477 | $this->userHandler->setDocumentClass(Document::class); |
478 | 478 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | public function getGraphHandler() |
484 | 484 | { |
485 | - if (! isset($this->graphHandler)) { |
|
485 | + if (!isset($this->graphHandler)) { |
|
486 | 486 | $this->graphHandler = new ArangoGraphHandler($this->arangoConnection); |
487 | 487 | $this->graphHandler->setDocumentClass(Document::class); |
488 | 488 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | public function getViewHandler() |
494 | 494 | { |
495 | - if (! isset($this->viewHandler)) { |
|
495 | + if (!isset($this->viewHandler)) { |
|
496 | 496 | $this->viewHandler = new ArangoViewHandler($this->arangoConnection); |
497 | 497 | $this->viewHandler->setDocumentClass(Document::class); |
498 | 498 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // Here we will replace the table place-holders with the table specified by |
70 | 70 | // the developer, which is useful for quickly creating a tables creation |
71 | 71 | // or update migration from the console instead of typing it manually. |
72 | - if (! is_null($collection)) { |
|
72 | + if (!is_null($collection)) { |
|
73 | 73 | $stub = str_replace('DummyCollection', $collection, $stub); |
74 | 74 | } |
75 | 75 | |
@@ -83,6 +83,6 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function stubPath() |
85 | 85 | { |
86 | - return __DIR__ . '/stubs'; |
|
86 | + return __DIR__.'/stubs'; |
|
87 | 87 | } |
88 | 88 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return true; |
32 | 32 | } |
33 | 33 | |
34 | - if (! is_array(reset($values))) { |
|
34 | + if (!is_array(reset($values))) { |
|
35 | 35 | $values = [$values]; |
36 | 36 | } |
37 | 37 | |
@@ -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 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | // foreign key name by using the name of the relationship function, which |
57 | 57 | // when combined with an "_id" should conventionally match the columns. |
58 | 58 | if (is_null($foreignKey)) { |
59 | - $foreignKey = Str::snake($relation) . $instance->getKeyName(); |
|
59 | + $foreignKey = Str::snake($relation).$instance->getKeyName(); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // Once we have the foreign key names, we'll just create a new Eloquent query |