@@ -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 |
@@ -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 | } |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | |
193 | 193 | foreach ($this->inputs as $key => $field) { |
194 | 194 | $newLine = ($field != end($this->inputs) or $this->hasAuth); |
195 | - $str .= "'$key' => " . '$this' . "->$key,".$this->makeTab(3, $newLine); |
|
195 | + $str .= "'$key' => ".'$this'."->$key,".$this->makeTab(3, $newLine); |
|
196 | 196 | } |
197 | 197 | |
198 | - if($this->hasAuth){ |
|
198 | + if ($this->hasAuth) { |
|
199 | 199 | $str .= "'user_id' => auth()->id(),"; |
200 | 200 | } |
201 | 201 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | /** |
206 | 206 | * Create Blade from stub |
207 | 207 | */ |
208 | - public function parseBlade($stub){ |
|
208 | + public function parseBlade($stub) { |
|
209 | 209 | $modelName = $this->getModelName($this->parsedModel); |
210 | 210 | |
211 | 211 | $array = [ |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | /** |
288 | 288 | * Tab Maker (Each tabs mean 4 space) |
289 | 289 | */ |
290 | - public function makeTab($count, $newLine = true){ |
|
290 | + public function makeTab($count, $newLine = true) { |
|
291 | 291 | $count = $count * 4; |
292 | 292 | $tabs = str_repeat(' ', $count); |
293 | 293 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | private function normalizeField($field) |
305 | 305 | { |
306 | - if($field instanceof Field){ |
|
306 | + if ($field instanceof Field) { |
|
307 | 307 | return $field; |
308 | 308 | } |
309 | 309 |