@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | private function mapWhereArray($string, array $array) |
166 | 166 | { |
167 | 167 | return array_map( |
168 | - function () use ($string) { |
|
168 | + function() use ($string) { |
|
169 | 169 | return $string; |
170 | 170 | }, array_flip($array) |
171 | 171 | ); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | private function mapIds(array $array) |
198 | 198 | { |
199 | 199 | return array_map( |
200 | - function (QueryHit $hit) { |
|
200 | + function(QueryHit $hit) { |
|
201 | 201 | return $hit->id; |
202 | 202 | }, $array |
203 | 203 | ); |
@@ -47,6 +47,10 @@ discard block |
||
47 | 47 | $this->models = $models; |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param string $type |
|
52 | + * @param string $string |
|
53 | + */ |
|
50 | 54 | private function output($type, $string) |
51 | 55 | { |
52 | 56 | if (! $this->output instanceof NullOutput) { |
@@ -67,7 +71,6 @@ discard block |
||
67 | 71 | } |
68 | 72 | |
69 | 73 | /** |
70 | - * @param array $models |
|
71 | 74 | */ |
72 | 75 | private function loopModels() |
73 | 76 | { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | private $progressBar; |
17 | 17 | private $store; |
18 | 18 | private $output; |
19 | - private $models = []; |
|
19 | + private $models = [ ]; |
|
20 | 20 | |
21 | 21 | public function __construct(ProgressBar $progressBar, Store $store, OutputInterface $output) |
22 | 22 | { |
@@ -31,25 +31,25 @@ discard block |
||
31 | 31 | */ |
32 | 32 | private function getModels() |
33 | 33 | { |
34 | - $models = []; |
|
34 | + $models = [ ]; |
|
35 | 35 | |
36 | 36 | foreach (get_declared_classes() as $class) { |
37 | 37 | if (is_subclass_of($class, Model::class) && method_exists($class, 'searchFields')) { |
38 | - $models[] = $class; |
|
38 | + $models[ ] = $class; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - return empty($models) ? [] : $models; |
|
42 | + return empty($models) ? [ ] : $models; |
|
43 | 43 | } |
44 | 44 | |
45 | - public function setModels(array $models = []) |
|
45 | + public function setModels(array $models = [ ]) |
|
46 | 46 | { |
47 | 47 | $this->models = $models; |
48 | 48 | } |
49 | 49 | |
50 | 50 | private function output($type, $string) |
51 | 51 | { |
52 | - if (! $this->output instanceof NullOutput) { |
|
52 | + if (!$this->output instanceof NullOutput) { |
|
53 | 53 | $this->output->$type($string); |
54 | 54 | } |
55 | 55 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | private function chunk(Model $object) |
103 | 103 | { |
104 | - $object->chunk(1000, function ($chunk) { |
|
104 | + $object->chunk(1000, function($chunk) { |
|
105 | 105 | foreach ($chunk as $record) { |
106 | 106 | $this->store->insertModel($record, false); |
107 | 107 | $this->progressBar->advance(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | private static function insertCallback(Store $store) |
74 | 74 | { |
75 | - return function (Model $model) use ($store) { |
|
75 | + return function(Model $model) use ($store) { |
|
76 | 76 | $store->model($model); |
77 | 77 | $store->insertModel($model); |
78 | 78 | }; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | private static function deleteCallback(Store $store) |
86 | 86 | { |
87 | - return function (Model $model) use ($store) { |
|
87 | + return function(Model $model) use ($store) { |
|
88 | 88 | $store->model($model); |
89 | 89 | $store->deleteModel($model); |
90 | 90 | }; |
@@ -40,21 +40,21 @@ |
||
40 | 40 | |
41 | 41 | $this->app->singleton( |
42 | 42 | 'command.search.rebuild', |
43 | - function () { |
|
43 | + function() { |
|
44 | 44 | return new Rebuild; |
45 | 45 | } |
46 | 46 | ); |
47 | 47 | |
48 | 48 | $this->app->singleton( |
49 | 49 | 'command.search.destroy', |
50 | - function () { |
|
50 | + function() { |
|
51 | 51 | return new Destroy; |
52 | 52 | } |
53 | 53 | ); |
54 | 54 | |
55 | 55 | $this->app->singleton( |
56 | 56 | 'command.search.optimise', |
57 | - function () { |
|
57 | + function() { |
|
58 | 58 | return new Optimise; |
59 | 59 | } |
60 | 60 | ); |