@@ -59,8 +59,9 @@ |
||
| 59 | 59 | protected function alterOptions($options) |
| 60 | 60 | { |
| 61 | 61 | $options['module'] = Str::studly($this->moduleName); |
| 62 | - if ($this->overwrite) |
|
| 63 | - $options['--overwrite'] = null; |
|
| 62 | + if ($this->overwrite) { |
|
| 63 | + $options['--overwrite'] = null; |
|
| 64 | + } |
|
| 64 | 65 | return $options; |
| 65 | 66 | } |
| 66 | 67 | |
@@ -29,8 +29,9 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function handle(ResourceGenerationContract $event) |
| 31 | 31 | { |
| 32 | - if (file_exists($event->getFilePath())) |
|
| 33 | - unlink($event->getFilePath()); |
|
| 32 | + if (file_exists($event->getFilePath())) { |
|
| 33 | + unlink($event->getFilePath()); |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | 36 | (new FileGenerator( |
| 36 | 37 | $event->getFilePath(), |
@@ -82,8 +82,9 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $this->beforeGeneration(); |
| 84 | 84 | |
| 85 | - if ($this->event === null) |
|
| 86 | - throw new Exception("No Generator event specified on " . static::class); |
|
| 85 | + if ($this->event === null) { |
|
| 86 | + throw new Exception("No Generator event specified on " . static::class); |
|
| 87 | + } |
|
| 87 | 88 | |
| 88 | 89 | event(new $this->event($path, $stub)); |
| 89 | 90 | $this->info("Created : {$path}"); |
@@ -258,16 +259,18 @@ discard block |
||
| 258 | 259 | return $this->option($key); |
| 259 | 260 | } elseif ($type === InputOption::VALUE_OPTIONAL || $type === InputOption::VALUE_IS_BOOL) { |
| 260 | 261 | if ($type !== InputOption::VALUE_IS_BOOL && ($input = $this->option($key)) !== null) { |
| 261 | - if (is_bool($default)) |
|
| 262 | - return (bool)$input; |
|
| 262 | + if (is_bool($default)) { |
|
| 263 | + return (bool)$input; |
|
| 264 | + } |
|
| 263 | 265 | return $input; |
| 264 | 266 | } else { |
| 265 | - if ($this->isShortcutBool($shortcut)) |
|
| 266 | - return $this->confirm($question, $default); |
|
| 267 | - else if (is_array($shortcut)) |
|
| 268 | - return $this->anticipate($question, $shortcut, $default); |
|
| 269 | - else |
|
| 270 | - return $this->ask($question, $default); |
|
| 267 | + if ($this->isShortcutBool($shortcut)) { |
|
| 268 | + return $this->confirm($question, $default); |
|
| 269 | + } else if (is_array($shortcut)) { |
|
| 270 | + return $this->anticipate($question, $shortcut, $default); |
|
| 271 | + } else { |
|
| 272 | + return $this->ask($question, $default); |
|
| 273 | + } |
|
| 271 | 274 | } |
| 272 | 275 | |
| 273 | 276 | } |
@@ -291,7 +294,8 @@ discard block |
||
| 291 | 294 | public function __call($method, $parameters) |
| 292 | 295 | { |
| 293 | 296 | $key = str_replace('get', '', $method); |
| 294 | - if (array_key_exists(strtolower($method), $this->optionData)) |
|
| 295 | - return $this->optionData[$key]; |
|
| 297 | + if (array_key_exists(strtolower($method), $this->optionData)) { |
|
| 298 | + return $this->optionData[$key]; |
|
| 299 | + } |
|
| 296 | 300 | } |
| 297 | 301 | } |