@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @param $fileName |
|
| 38 | + * @param string $fileName |
|
| 39 | 39 | * @param string $prompt |
| 40 | 40 | * |
| 41 | 41 | * @return bool |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | 'to' => new Flysystem(new LocalAdapter($to)), |
| 92 | 92 | ]); |
| 93 | 93 | foreach ($manager->listContents('from://', true) as $file) { |
| 94 | - if ($file['type'] === 'file' && (!$manager->has('to://'.$file['path']) || $this->force)) { |
|
| 95 | - $manager->put('to://'.$file['path'], $manager->read('from://'.$file['path'])); |
|
| 94 | + if ($file[ 'type' ] === 'file' && (!$manager->has('to://'.$file[ 'path' ]) || $this->force)) { |
|
| 95 | + $manager->put('to://'.$file[ 'path' ], $manager->read('from://'.$file[ 'path' ])); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | $this->status($from, $to, 'Directory'); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $from = str_replace(base_path(), '', realpath($from)); |
| 113 | 113 | $to = str_replace(base_path(), '', realpath($to)); |
| 114 | - $this->line('<info>Copied '. $type. '</info> <comment>['. $from. |
|
| 114 | + $this->line('<info>Copied '.$type.'</info> <comment>['.$from. |
|
| 115 | 115 | ']</comment> <info>To</info> <comment>['.$to.']</comment>'); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -90,15 +90,15 @@ |
||
| 90 | 90 | 'showcase' => 'Витрина', |
| 91 | 91 | 'contact' => 'Контакт', |
| 92 | 92 | 'laravelpackage' => '5 package that switchs default Laravel', |
| 93 | - 'to' => 'to', // never ever again |
|
| 93 | + 'to' => 'to', // never ever again |
|
| 94 | 94 | 'templatewith' => 'template with', |
| 95 | - 'and' => 'and', // put in a i18n files separate |
|
| 95 | + 'and' => 'and', // put in a i18n files separate |
|
| 96 | 96 | 'gedstarted' => 'Get Started!', |
| 97 | 97 | 'amazing' => 'Amazing admin template', |
| 98 | 98 | 'basedadminlte' => 'Based on adminlte bootstrap theme', |
| 99 | 99 | 'awesomepackaged' => 'Awesome packaged...', |
| 100 | - 'by' => 'by', // auxiliary/functional/syntactic words |
|
| 101 | - 'at' => 'at', // or translator-nazi will find you by IP |
|
| 100 | + 'by' => 'by', // auxiliary/functional/syntactic words |
|
| 101 | + 'at' => 'at', // or translator-nazi will find you by IP |
|
| 102 | 102 | 'readytouse' => 'ready to use with Laravel!', |
| 103 | 103 | 'designed' => 'Designed To Excel', |
| 104 | 104 | 'community' => 'Community', |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | protected function checkIfSpatieMenuAlreadyInstalled() |
| 73 | 73 | { |
| 74 | - if ((app()->getProvider('Spatie\Menu\Laravel\MenuServiceProvider')) && ! $this->force) { |
|
| 74 | + if ((app()->getProvider('Spatie\Menu\Laravel\MenuServiceProvider')) && !$this->force) { |
|
| 75 | 75 | throw new SpatieMenuAlreadyExists(); |
| 76 | 76 | } |
| 77 | 77 | return; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getStubPath() |
| 34 | 34 | { |
| 35 | - return __DIR__ . '/../stubs/route_with_resource_controller.stub'; |
|
| 35 | + return __DIR__.'/../stubs/route_with_resource_controller.stub'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | protected function obtainReplacements() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 47 | - 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 46 | + 'ROUTE_LINK' => $this->getReplacements()[ 0 ], |
|
| 47 | + 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]), |
|
| 48 | 48 | ]; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -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 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * Check if route exists. |
| 147 | 147 | * |
| 148 | 148 | * @param $link |
| 149 | - * @return mixed |
|
| 149 | + * @return boolean |
|
| 150 | 150 | */ |
| 151 | 151 | protected function routeExists($link) |
| 152 | 152 | { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * Check if web route exists. |
| 161 | 161 | * |
| 162 | 162 | * @param $link |
| 163 | - * @return mixed |
|
| 163 | + * @return boolean |
|
| 164 | 164 | */ |
| 165 | 165 | protected function webRouteExists($link) |
| 166 | 166 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * Remove duplicated trailing slashes. |
| 194 | 194 | * |
| 195 | - * @param $link |
|
| 195 | + * @param string $link |
|
| 196 | 196 | * @return mixed |
| 197 | 197 | */ |
| 198 | 198 | protected function removeDuplicatedTrailingSlashes($link) |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * Check if api route exists. |
| 205 | 205 | * |
| 206 | 206 | * @param $link |
| 207 | - * @return mixed |
|
| 207 | + * @return boolean |
|
| 208 | 208 | */ |
| 209 | 209 | protected function apiRouteExists($link) |
| 210 | 210 | { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Crete tmp file with route to add. |
| 216 | 216 | * |
| 217 | - * @return mixed |
|
| 217 | + * @return resource |
|
| 218 | 218 | */ |
| 219 | 219 | protected function createTmpFileWithRoute() |
| 220 | 220 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * Get path from file resource. |
| 228 | 228 | * |
| 229 | - * @param $tmpfile |
|
| 229 | + * @param resource $tmpfile |
|
| 230 | 230 | * @return mixed |
| 231 | 231 | */ |
| 232 | 232 | protected function getPath($tmpfile) |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | /** |
| 238 | 238 | * Get route code to insert depending on type. |
| 239 | 239 | * |
| 240 | - * @return mixed |
|
| 240 | + * @return string |
|
| 241 | 241 | */ |
| 242 | 242 | protected function getRouteCode() |
| 243 | 243 | { |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | /** |
| 379 | 379 | * Add method to controller. |
| 380 | 380 | * |
| 381 | - * @param $controller |
|
| 382 | - * @param $controllerMethod * |
|
| 381 | + * @param string $controller |
|
| 382 | + * @param string $controllerMethod * |
|
| 383 | 383 | */ |
| 384 | 384 | protected function addMethodToController($controller, $controllerMethod) |
| 385 | 385 | { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | * Crete tmp file with route to add. |
| 393 | 393 | * |
| 394 | 394 | * @param $controllerMethod |
| 395 | - * @return mixed |
|
| 395 | + * @return resource |
|
| 396 | 396 | */ |
| 397 | 397 | protected function createTmpFileWithMethod($controllerMethod) |
| 398 | 398 | { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | * Get method code. |
| 406 | 406 | * |
| 407 | 407 | * @param $controllerMethod |
| 408 | - * @return mixed |
|
| 408 | + * @return string |
|
| 409 | 409 | */ |
| 410 | 410 | protected function getMethodCode($controllerMethod) |
| 411 | 411 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $tmpfile = $this->createTmpFileWithRoute(); |
| 100 | 100 | $path = $this->getPath($tmpfile); |
| 101 | 101 | add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
| 102 | - $this->info('Route ' . undot_path($link) . ' added to ' . $dstFile . '.'); |
|
| 102 | + $this->info('Route '.undot_path($link).' added to '.$dstFile.'.'); |
|
| 103 | 103 | $this->postActions(); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $link = $this->removeTrailingSlashIfExists($link); |
| 170 | 170 | $link = $this->removeDuplicatedTrailingSlashes($link); |
| 171 | 171 | foreach (Route::getRoutes() as $value) { |
| 172 | - if (in_array(strtoupper($this->option('method')), array_merge($value->methods(), ['ANY'])) && |
|
| 172 | + if (in_array(strtoupper($this->option('method')), array_merge($value->methods(), [ 'ANY' ])) && |
|
| 173 | 173 | $value->uri() === $link) { |
| 174 | 174 | return true; |
| 175 | 175 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | protected function apiRouteExists($link) |
| 212 | 212 | { |
| 213 | - return $this->webRouteExists('api/v1/' . $link); |
|
| 213 | + return $this->webRouteExists('api/v1/'.$link); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | protected function getPath($tmpfile) |
| 235 | 235 | { |
| 236 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 236 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | protected function getRouteCode() |
| 245 | 245 | { |
| 246 | 246 | $type = $this->option('type'); |
| 247 | - $class = isset(static::$lookup[$type]) |
|
| 248 | - ? static::$lookup[$type] |
|
| 247 | + $class = isset(static::$lookup[ $type ]) |
|
| 248 | + ? static::$lookup[ $type ] |
|
| 249 | 249 | : RegularRoute::class; |
| 250 | 250 | /** @var GeneratesCode $route */ |
| 251 | 251 | $route = new $class($this->compiler, $this->filesystem); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | return $this->argument('action'); |
| 282 | 282 | } |
| 283 | 283 | if (strtolower($this->option('type')) != 'regular') { |
| 284 | - return $this->argument('link') . 'Controller'; |
|
| 284 | + return $this->argument('link').'Controller'; |
|
| 285 | 285 | } |
| 286 | 286 | return $this->argument('link'); |
| 287 | 287 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | protected function validateMethod() |
| 302 | 302 | { |
| 303 | - if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) { |
|
| 303 | + if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) { |
|
| 304 | 304 | throw new MethodNotAllowedException($methods); |
| 305 | 305 | } |
| 306 | 306 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | */ |
| 311 | 311 | protected function validateType() |
| 312 | 312 | { |
| 313 | - if (! in_array(strtolower($this->option('type')), ['regular','controller','resource'])) { |
|
| 313 | + if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) { |
|
| 314 | 314 | throw new RouteTypeNotValid(); |
| 315 | 315 | } |
| 316 | 316 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | 'link' => $link = undot_path($this->argument('link')), |
| 348 | 348 | 'name' => ucfirst($link), |
| 349 | 349 | ]); |
| 350 | - $this->info('Menu entry ' . $link .' added to config/menu.php file.'); |
|
| 350 | + $this->info('Menu entry '.$link.' added to config/menu.php file.'); |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /** |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | Artisan::call('make:view', [ |
| 390 | 390 | 'name' => $name |
| 391 | 391 | ]); |
| 392 | - $this->info('View ' . undot_path($name) .'.blade.php created.'); |
|
| 392 | + $this->info('View '.undot_path($name).'.blade.php created.'); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /** |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | 'name' => $controller = $this->controllerWithoutMethod($this->action()) |
| 402 | 402 | ]); |
| 403 | 403 | $this->addMethodToController($controller, $this->controllerMethod($this->action())); |
| 404 | - $this->info('Controller ' . $controller .' created.'); |
|
| 404 | + $this->info('Controller '.$controller.' created.'); |
|
| 405 | 405 | $this->createView($this->argument('link')); |
| 406 | 406 | } |
| 407 | 407 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | 'name' => $controller = $this->controllerWithoutMethod($this->action()), |
| 415 | 415 | '--resource' => true |
| 416 | 416 | ]); |
| 417 | - $this->info('Resource Controller ' . $controller .' created.'); |
|
| 417 | + $this->info('Resource Controller '.$controller.' created.'); |
|
| 418 | 418 | $this->createView($this->argument('link')); |
| 419 | 419 | } |
| 420 | 420 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | { |
| 429 | 429 | $tmpfile = $this->createTmpFileWithMethod($controllerMethod); |
| 430 | 430 | $path = $this->getPath($tmpfile); |
| 431 | - add_file_into_file('\/\/', $path, app_path('Http/Controllers/' . $controller . '.php')); |
|
| 431 | + add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php')); |
|
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /** |
@@ -468,6 +468,6 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | protected function getMethodStubPath() |
| 470 | 470 | { |
| 471 | - return __DIR__ . '/stubs/method.stub'; |
|
| 471 | + return __DIR__.'/stubs/method.stub'; |
|
| 472 | 472 | } |
| 473 | 473 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $tmpfile = $this->createTmpFileWithMenu(); |
| 79 | 79 | $path = $this->getPath($tmpfile); |
| 80 | 80 | add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
| 81 | - $this->info('Menu ' . $this->name() . ' added to ' . $dstFile . '.'); |
|
| 81 | + $this->info('Menu '.$this->name().' added to '.$dstFile.'.'); |
|
| 82 | 82 | $this->postActions(); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -122,8 +122,8 @@ discard block |
||
| 122 | 122 | protected function getMenuCode() |
| 123 | 123 | { |
| 124 | 124 | $type = $this->option('type'); |
| 125 | - $class = isset(static::$lookup[$type]) |
|
| 126 | - ? static::$lookup[$type] |
|
| 125 | + $class = isset(static::$lookup[ $type ]) |
|
| 126 | + ? static::$lookup[ $type ] |
|
| 127 | 127 | : RegularMenu::class; |
| 128 | 128 | /** @var GeneratesCode $route */ |
| 129 | 129 | $route = new $class($this->compiler, $this->filesystem); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | protected function getPath($tmpfile) |
| 144 | 144 | { |
| 145 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 145 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | protected function getStubPath() |
| 33 | 33 | { |
| 34 | - return __DIR__ . '/../stubs/menu.stub'; |
|
| 34 | + return __DIR__.'/../stubs/menu.stub'; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | protected function obtainReplacements() |
| 41 | 41 | { |
| 42 | 42 | return [ |
| 43 | - 'MENU_LINK' => $this->getReplacements()[0], |
|
| 44 | - 'MENU_NAME' => $this->getReplacements()[1] |
|
| 43 | + 'MENU_LINK' => $this->getReplacements()[ 0 ], |
|
| 44 | + 'MENU_NAME' => $this->getReplacements()[ 1 ] |
|
| 45 | 45 | ]; |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getStubPath() |
| 34 | 34 | { |
| 35 | - return __DIR__ . '/../stubs/route_with_controller.stub'; |
|
| 35 | + return __DIR__.'/../stubs/route_with_controller.stub'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | protected function obtainReplacements() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - 'ROUTE_LINK' => $link = $this->getReplacements()[0], |
|
| 47 | - 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 48 | - 'ROUTE_METHOD' => $this->getReplacements()[2], |
|
| 46 | + 'ROUTE_LINK' => $link = $this->getReplacements()[ 0 ], |
|
| 47 | + 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]), |
|
| 48 | + 'ROUTE_METHOD' => $this->getReplacements()[ 2 ], |
|
| 49 | 49 | 'ROUTE_NAME' => dot_path($link), |
| 50 | 50 | ]; |
| 51 | 51 | } |