@@ -48,15 +48,15 @@ discard block |
||
48 | 48 | $this->store = $store; |
49 | 49 | } |
50 | 50 | |
51 | - public function setAuthType(bool $hasAuth){ |
|
51 | + public function setAuthType(bool $hasAuth) { |
|
52 | 52 | $this->hasAuth = $hasAuth; |
53 | 53 | } |
54 | 54 | |
55 | - public function setFields(array $fields){ |
|
55 | + public function setFields(array $fields) { |
|
56 | 56 | $this->fields = $fields; |
57 | 57 | } |
58 | 58 | |
59 | - public function setInputs(array $inputs){ |
|
59 | + public function setInputs(array $inputs) { |
|
60 | 60 | $this->inputs = $inputs; |
61 | 61 | } |
62 | 62 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $decodedFile = json_decode(File::get($file), 1); |
93 | 93 | $texts = $this->texts; |
94 | 94 | foreach ($texts as $key => $text) { |
95 | - if (array_key_exists($key, $decodedFile)){ |
|
95 | + if (array_key_exists($key, $decodedFile)) { |
|
96 | 96 | unset($texts[$text]); |
97 | 97 | } |
98 | 98 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $fields = array_keys($this->inputs); |
120 | 120 | $str = ''; |
121 | 121 | |
122 | - if(in_array($this->inputName, $fields)){ |
|
122 | + if (in_array($this->inputName, $fields)) { |
|
123 | 123 | $this->error("Model name must not equal to column names, fix it and rerun command with -f flag"); |
124 | 124 | die; |
125 | 125 | } |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | |
191 | 191 | foreach ($this->inputs as $key => $field) { |
192 | 192 | $newLine = ($field != end($this->inputs) or $this->hasAuth); |
193 | - $str .= "'$key' => " . '$this' . "->$key,".$this->makeTab(3, $newLine); |
|
193 | + $str .= "'$key' => ".'$this'."->$key,".$this->makeTab(3, $newLine); |
|
194 | 194 | } |
195 | 195 | |
196 | - if($this->hasAuth){ |
|
196 | + if ($this->hasAuth) { |
|
197 | 197 | $str .= "'user_id' => auth()->id(),"; |
198 | 198 | } |
199 | 199 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | /** |
204 | 204 | * Create Blade from stub |
205 | 205 | */ |
206 | - public function parseBlade($stub){ |
|
206 | + public function parseBlade($stub) { |
|
207 | 207 | $modelName = $this->getModelName($this->parsedModel); |
208 | 208 | |
209 | 209 | $array = [ |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | foreach ($fields as $key => $field) { |
232 | 232 | $str .= $field->setModel($modelName)->setKey($key)->renderData(); |
233 | 233 | |
234 | - if (array_key_first($fields) != $key){ |
|
234 | + if (array_key_first($fields) != $key) { |
|
235 | 235 | $str .= $this->makeTab(1, array_key_last($fields) != $key); |
236 | 236 | } |
237 | 237 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | foreach ($fields as $key => $field) { |
253 | 253 | $str .= $field->setModel($modelName)->setKey($key)->renderTitle(); |
254 | 254 | |
255 | - if (array_key_first($fields) != $key){ |
|
255 | + if (array_key_first($fields) != $key) { |
|
256 | 256 | $str .= $this->makeTab(6, array_key_last($fields) != $key); |
257 | 257 | } |
258 | 258 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | /** |
282 | 282 | * Tab Maker (Each tabs mean 4 space) |
283 | 283 | */ |
284 | - public function makeTab($count, $newLine = true){ |
|
284 | + public function makeTab($count, $newLine = true) { |
|
285 | 285 | $count = $count * 4; |
286 | 286 | $tabs = str_repeat(' ', $count); |
287 | 287 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | public static function get($name) |
25 | 25 | { |
26 | - if (!key_exists($name, static::inputClassMap)){ |
|
26 | + if (!key_exists($name, static::inputClassMap)) { |
|
27 | 27 | throw new \Exception("The [$name] input type doesn't exist in input list!"); |
28 | 28 | } |
29 | 29 |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | private function getTitleStubContent() |
139 | 139 | { |
140 | - if ($this->isRelational()){ |
|
140 | + if ($this->isRelational()) { |
|
141 | 141 | return file_get_contents(__DIR__.'/stubs/titles/relational.stub'); |
142 | 142 | } |
143 | 143 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return \Str::contains($this->key, '.'); |
150 | 150 | } |
151 | 151 | |
152 | - private function parseRelationalKey($key){ |
|
152 | + private function parseRelationalKey($key) { |
|
153 | 153 | return str_replace('.', '->', $key); |
154 | 154 | } |
155 | 155 |