We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -34,21 +34,21 @@ discard block |
||
34 | 34 | { |
35 | 35 | // Validate validation option |
36 | 36 | $validation = $this->handleValidationOption(); |
37 | - if (! $validation) { |
|
37 | + if (!$validation) { |
|
38 | 38 | return false; |
39 | 39 | } |
40 | 40 | |
41 | 41 | // make a list of all models |
42 | 42 | $models = $this->getModels(base_path('app')); |
43 | 43 | |
44 | - if (! count($models)) { |
|
44 | + if (!count($models)) { |
|
45 | 45 | $this->errorBlock('No models found.'); |
46 | 46 | |
47 | 47 | return false; |
48 | 48 | } |
49 | 49 | |
50 | 50 | foreach ($models as $model) { |
51 | - $this->call('backpack:crud', ['name' => $model, '--validation' => $validation]); |
|
51 | + $this->call('backpack:crud', [ 'name' => $model, '--validation' => $validation ]); |
|
52 | 52 | $this->line(' <fg=gray>----------</>'); |
53 | 53 | } |
54 | 54 | |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | |
58 | 58 | private function getModels(string $path): array |
59 | 59 | { |
60 | - $out = []; |
|
60 | + $out = [ ]; |
|
61 | 61 | $results = scandir($path); |
62 | 62 | |
63 | 63 | foreach ($results as $result) { |
64 | 64 | $filepath = "$path/$result"; |
65 | 65 | |
66 | 66 | // ignore `.` (dot) prefixed files |
67 | - if ($result[0] === '.') { |
|
67 | + if ($result[ 0 ] === '.') { |
|
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $result = $this->validateModelClass($class); |
85 | 85 | if ($result) { |
86 | - $out[] = $result; |
|
86 | + $out[ ] = $result; |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $result = $this->validateModelClass("$namespace\\$classname"); |
96 | 96 | if ($result) { |
97 | - $out[] = $result; |
|
97 | + $out[ ] = $result; |
|
98 | 98 | continue; |
99 | 99 | } |
100 | 100 | } |
@@ -109,24 +109,24 @@ discard block |
||
109 | 109 | */ |
110 | 110 | private function handleValidationOption() |
111 | 111 | { |
112 | - $options = ['request', 'array', 'field']; |
|
112 | + $options = [ 'request', 'array', 'field' ]; |
|
113 | 113 | |
114 | 114 | // Validate validation option |
115 | 115 | $validation = $this->option('validation'); |
116 | 116 | |
117 | - if (! $validation) { |
|
117 | + if (!$validation) { |
|
118 | 118 | $validation = $this->askHint( |
119 | 119 | 'How would you like to define your validation rules, for the Create and Update operations?', [ |
120 | 120 | 'More info at <fg=blue>https://backpackforlaravel.com/docs/5.x/crud-operation-create#validation</>', |
121 | 121 | 'Valid options are <fg=blue>request</>, <fg=blue>array</> or <fg=blue>field</>', |
122 | - ], $options[0]); |
|
122 | + ], $options[ 0 ]); |
|
123 | 123 | |
124 | - if (! $this->option('no-interaction')) { |
|
124 | + if (!$this->option('no-interaction')) { |
|
125 | 125 | $this->deleteLines(5); |
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | - if (! in_array($validation, $options)) { |
|
129 | + if (!in_array($validation, $options)) { |
|
130 | 130 | $this->errorBlock("The validation must be request, array or field. '$validation' is not valid."); |
131 | 131 | |
132 | 132 | return false; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | try { |
141 | 141 | $reflection = new \ReflectionClass($class); |
142 | 142 | |
143 | - if ($reflection->isSubclassOf(Model::class) && ! $reflection->isAbstract()) { |
|
143 | + if ($reflection->isSubclassOf(Model::class) && !$reflection->isAbstract()) { |
|
144 | 144 | return Str::of($class)->afterLast('\\'); |
145 | 145 | } |
146 | 146 | } catch (\Throwable$e) { |