@@ -59,8 +59,9 @@ |
||
| 59 | 59 | { |
| 60 | 60 | return once(function () { |
| 61 | 61 | $option = $this->option('sync'); |
| 62 | - if ($option !== null) |
|
| 63 | - $option = (bool)$option; |
|
| 62 | + if ($option !== null) { |
|
| 63 | + $option = (bool)$option; |
|
| 64 | + } |
|
| 64 | 65 | |
| 65 | 66 | return $option === null ? $this->confirm('Should the job run Synchronously?', false) : $option; |
| 66 | 67 | }); |
@@ -71,8 +71,9 @@ |
||
| 71 | 71 | { |
| 72 | 72 | return once(function () { |
| 73 | 73 | $option = $this->option('mongo'); |
| 74 | - if ($option !== null) |
|
| 75 | - $option = (bool)$option; |
|
| 74 | + if ($option !== null) { |
|
| 75 | + $option = (bool)$option; |
|
| 76 | + } |
|
| 76 | 77 | |
| 77 | 78 | return $option === null ? $this->confirm('Is this migration for a mongodb database?', false) : $option; |
| 78 | 79 | }); |
@@ -231,8 +231,9 @@ |
||
| 231 | 231 | $splittedInCapsName = preg_split('/(?=[A-Z])/', $string); |
| 232 | 232 | $i = 0; |
| 233 | 233 | foreach ($splittedInCapsName as $word) { |
| 234 | - if ($i !== 0) |
|
| 235 | - $splittedString = $splittedString . $word . '_'; |
|
| 234 | + if ($i !== 0) { |
|
| 235 | + $splittedString = $splittedString . $word . '_'; |
|
| 236 | + } |
|
| 236 | 237 | $i++; |
| 237 | 238 | } |
| 238 | 239 | |
@@ -69,8 +69,9 @@ |
||
| 69 | 69 | { |
| 70 | 70 | $type = $this->getType(); |
| 71 | 71 | |
| 72 | - if (in_array($type, $this->types)) |
|
| 73 | - return "$type-test.stub"; |
|
| 72 | + if (in_array($type, $this->types)) { |
|
| 73 | + return "$type-test.stub"; |
|
| 74 | + } |
|
| 74 | 75 | |
| 75 | 76 | throw new Exception("Test type not supported"); |
| 76 | 77 | } |
@@ -36,8 +36,9 @@ |
||
| 36 | 36 | protected function getFirstDispatchedEvent(?string $class): ResourceGenerationContract |
| 37 | 37 | { |
| 38 | 38 | $events = $this->getDispatchedEvents($class); |
| 39 | - if (empty($events)) |
|
| 40 | - return null; |
|
| 39 | + if (empty($events)) { |
|
| 40 | + return null; |
|
| 41 | + } |
|
| 41 | 42 | return $events[0]; |
| 42 | 43 | } |
| 43 | 44 | } |
@@ -87,11 +87,12 @@ |
||
| 87 | 87 | |
| 88 | 88 | public function __call($name, $arguments) |
| 89 | 89 | { |
| 90 | - if (Str::startsWith($name, 'add')) |
|
| 91 | - $this->pipeline[] = [ |
|
| 90 | + if (Str::startsWith($name, 'add')) { |
|
| 91 | + $this->pipeline[] = [ |
|
| 92 | 92 | "name" => Str::replaceFirst('add', '', $name), |
| 93 | 93 | "arguments" => $arguments |
| 94 | 94 | ]; |
| 95 | + } |
|
| 95 | 96 | |
| 96 | 97 | } |
| 97 | 98 | |
@@ -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 | } |