@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $tmpfile = $this->createTmpFileWithRoute(); |
| 98 | 98 | $path = $this->getPath($tmpfile); |
| 99 | 99 | add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
| 100 | - $this->info('Route ' . $link . ' added to ' . $dstFile . '.'); |
|
| 100 | + $this->info('Route '.$link.' added to '.$dstFile.'.'); |
|
| 101 | 101 | $this->postActions(); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $link = $this->removeTrailingSlashIfExists($link); |
| 168 | 168 | $link = $this->removeDuplicatedTrailingSlashes($link); |
| 169 | 169 | foreach (Route::getRoutes() as $value) { |
| 170 | - if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) && |
|
| 170 | + if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) && |
|
| 171 | 171 | $value->getPath() === $link) { |
| 172 | 172 | return true; |
| 173 | 173 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | protected function apiRouteExists($link) |
| 210 | 210 | { |
| 211 | - return $this->webRouteExists('api/v1/' . $link); |
|
| 211 | + return $this->webRouteExists('api/v1/'.$link); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | protected function getPath($tmpfile) |
| 233 | 233 | { |
| 234 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 234 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | protected function getRouteCode() |
| 243 | 243 | { |
| 244 | 244 | $type = $this->option('type'); |
| 245 | - $class = isset(static::$lookup[$type]) |
|
| 246 | - ? static::$lookup[$type] |
|
| 245 | + $class = isset(static::$lookup[ $type ]) |
|
| 246 | + ? static::$lookup[ $type ] |
|
| 247 | 247 | : RegularRoute::class; |
| 248 | 248 | /** @var GeneratesCode $route */ |
| 249 | 249 | $route = new $class($this->compiler, $this->filesystem); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | if ($this->argument('action') != null) { |
| 279 | 279 | return $this->argument('action'); |
| 280 | 280 | } |
| 281 | - return $this->argument('link') . 'Controller'; |
|
| 281 | + return $this->argument('link').'Controller'; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | protected function validateMethod() |
| 297 | 297 | { |
| 298 | - if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) { |
|
| 298 | + if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) { |
|
| 299 | 299 | throw new MethodNotAllowedException($methods); |
| 300 | 300 | } |
| 301 | 301 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | protected function validateType() |
| 307 | 307 | { |
| 308 | - if (! in_array(strtolower($this->option('type')), ['regular','controller','resource'])) { |
|
| 308 | + if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) { |
|
| 309 | 309 | throw new RouteTypeNotValid(); |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | Artisan::call('make:view', [ |
| 343 | 343 | 'name' => $this->action() |
| 344 | 344 | ]); |
| 345 | - $this->info('View ' . $this->action() .'.blade.php created.'); |
|
| 345 | + $this->info('View '.$this->action().'.blade.php created.'); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | 'name' => $controller = $this->controllerWithoutMethod($this->action()) |
| 355 | 355 | ]); |
| 356 | 356 | $this->addMethodToController($controller, $this->controllerMethod($this->action())); |
| 357 | - $this->info('Controller ' . $controller .' created.'); |
|
| 357 | + $this->info('Controller '.$controller.' created.'); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /** |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | 'name' => $controller = $this->controllerWithoutMethod($this->action()), |
| 367 | 367 | '--resource' => true |
| 368 | 368 | ]); |
| 369 | - $this->info('Resource Controller ' . $controller .' created.'); |
|
| 369 | + $this->info('Resource Controller '.$controller.' created.'); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | { |
| 380 | 380 | $tmpfile = $this->createTmpFileWithMethod($controllerMethod); |
| 381 | 381 | $path = $this->getPath($tmpfile); |
| 382 | - add_file_into_file('\/\/', $path, app_path('Http/Controllers/' . $controller . '.php')); |
|
| 382 | + add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php')); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -418,6 +418,6 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | protected function getMethodStubPath() |
| 420 | 420 | { |
| 421 | - return __DIR__ . '/stubs/method.stub'; |
|
| 421 | + return __DIR__.'/stubs/method.stub'; |
|
| 422 | 422 | } |
| 423 | 423 | } |