@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | if (str_contains($controllername, '@')) { |
| 25 | 25 | return ucfirst($controllername); |
| 26 | 26 | } |
| 27 | - return ucfirst($controllername . '@index'); |
|
| 27 | + return ucfirst($controllername.'@index'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | protected function controllerMethod($controllername) |
| 51 | 51 | { |
| 52 | 52 | if (str_contains($controller = $controllername, '@')) { |
| 53 | - return substr($controllername, strpos($controllername, '@')+1, strlen($controllername)); |
|
| 53 | + return substr($controllername, strpos($controllername, '@') + 1, strlen($controllername)); |
|
| 54 | 54 | } |
| 55 | 55 | return 'index'; |
| 56 | 56 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $tmpfile = $this->createTmpFileWithRoute(); |
| 96 | 96 | $path = $this->getPath($tmpfile); |
| 97 | 97 | add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
| 98 | - $this->info('Route ' . $link . ' added to ' . $dstFile . '.'); |
|
| 98 | + $this->info('Route '.$link.' added to '.$dstFile.'.'); |
|
| 99 | 99 | $this->postActions(); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $link = $this->removeTrailingSlashIfExists($link); |
| 166 | 166 | $link = $this->removeDuplicatedTrailingSlashes($link); |
| 167 | 167 | foreach (Route::getRoutes() as $value) { |
| 168 | - if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) && $value->getPath() === $link) { |
|
| 168 | + if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) && $value->getPath() === $link) { |
|
| 169 | 169 | return true; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | protected function apiRouteExists($link) |
| 207 | 207 | { |
| 208 | - return $this->webRouteExists('api/v1/' . $link); |
|
| 208 | + return $this->webRouteExists('api/v1/'.$link); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | protected function getPath($tmpfile) |
| 230 | 230 | { |
| 231 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 231 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | protected function getRouteCode() |
| 240 | 240 | { |
| 241 | 241 | $type = $this->option('type'); |
| 242 | - $class = isset(static::$lookup[$type]) |
|
| 243 | - ? static::$lookup[$type] |
|
| 242 | + $class = isset(static::$lookup[ $type ]) |
|
| 243 | + ? static::$lookup[ $type ] |
|
| 244 | 244 | : RegularRoute::class; |
| 245 | 245 | /** @var GeneratesCode $route */ |
| 246 | 246 | $route = new $class($this->compiler, $this->filesystem); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | if ($this->argument('action') != null) { |
| 276 | 276 | return $this->argument('action'); |
| 277 | 277 | } |
| 278 | - return $this->argument('link') . 'Controller'; |
|
| 278 | + return $this->argument('link').'Controller'; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | */ |
| 293 | 293 | protected function validateMethod() |
| 294 | 294 | { |
| 295 | - if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) { |
|
| 295 | + if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) { |
|
| 296 | 296 | throw new MethodNotAllowedException($methods); |
| 297 | 297 | } |
| 298 | 298 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | protected function validateType() |
| 304 | 304 | { |
| 305 | - if (! in_array(strtolower($this->option('type')), ['regular','controller','resource'])) { |
|
| 305 | + if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) { |
|
| 306 | 306 | throw new RouteTypeNotValid(); |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | Artisan::call('make:view', [ |
| 340 | 340 | 'name' => $this->action() |
| 341 | 341 | ]); |
| 342 | - $this->info('View ' . $this->action() .'.blade.php created.'); |
|
| 342 | + $this->info('View '.$this->action().'.blade.php created.'); |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | 'name' => $controller = $this->controllerWithoutMethod($this->action()) |
| 352 | 352 | ]); |
| 353 | 353 | $this->addMethodToController($controller, $this->controllerMethod($this->action())); |
| 354 | - $this->info('Controller ' . $controller .' created.'); |
|
| 354 | + $this->info('Controller '.$controller.' created.'); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | 'name' => $controller = $this->controllerWithoutMethod($this->action()), |
| 364 | 364 | '--resource' => true |
| 365 | 365 | ]); |
| 366 | - $this->info('Resource Controller ' . $controller .' created.'); |
|
| 366 | + $this->info('Resource Controller '.$controller.' created.'); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | { |
| 377 | 377 | $tmpfile = $this->createTmpFileWithMethod($controllerMethod); |
| 378 | 378 | $path = $this->getPath($tmpfile); |
| 379 | - add_file_into_file('\/\/', $path, app_path('Http/Controllers/' . $controller . '.php')); |
|
| 379 | + add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php')); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /** |
@@ -415,6 +415,6 @@ discard block |
||
| 415 | 415 | */ |
| 416 | 416 | protected function getMethodStubPath() |
| 417 | 417 | { |
| 418 | - return __DIR__ . '/stubs/method.stub'; |
|
| 418 | + return __DIR__.'/stubs/method.stub'; |
|
| 419 | 419 | } |
| 420 | 420 | } |