| Conditions | 2 |
| Paths | 2 |
| Total Lines | 55 |
| Code Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 52 | public function boot(LocalisationRegistrar $localisationLoader, Filesystem $filesystem) |
||
| 53 | { |
||
| 54 | include __DIR__ . '/../routes/web.php'; |
||
| 55 | |||
| 56 | if (true === function_exists('config_path')) { |
||
| 57 | // function not available and 'publish' not relevant in Lumen |
||
| 58 | $this->publishes( |
||
| 59 | [ |
||
| 60 | __DIR__ . '/../config/localisation.php' => config_path('pwweb/localisation.php'), |
||
| 61 | ], |
||
| 62 | 'pwweb.localisation.config' |
||
| 63 | ); |
||
| 64 | |||
| 65 | $this->publishes( |
||
| 66 | [ |
||
| 67 | __DIR__ . '/../database/migrations/create_localisation_tables.php.stub' => $this->getMigrationFileName($filesystem), |
||
| 68 | ], |
||
| 69 | 'pwweb.localisation.migrations' |
||
| 70 | ); |
||
| 71 | |||
| 72 | $this->publishes( |
||
| 73 | [ |
||
| 74 | __DIR__ . '/resources/lang' => resource_path('lang/vendor/pwweb'), |
||
| 75 | ] |
||
| 76 | ); |
||
| 77 | |||
| 78 | $this->publishes( |
||
| 79 | [ |
||
| 80 | __DIR__ . '/resources/views' => base_path('resources/views/vendor/localisation'), |
||
| 81 | ], |
||
| 82 | 'views' |
||
| 83 | ); |
||
| 84 | }//end if |
||
| 85 | |||
| 86 | $this->commands( |
||
| 87 | [ |
||
| 88 | Commands\CacheReset::class, |
||
| 89 | ] |
||
| 90 | ); |
||
| 91 | |||
| 92 | $this->loadTranslationsFrom(realpath(__DIR__ . '/resources/lang'), 'pwweb'); |
||
| 93 | |||
| 94 | $this->registerModelBindings(); |
||
| 95 | |||
| 96 | $localisationLoader->clearClassLanguages(); |
||
| 97 | $localisationLoader->registerLanguages(); |
||
| 98 | |||
| 99 | $this->app->bind('localisation', \PWWeb\Localisation\Localisation::class); |
||
| 100 | $loader = AliasLoader::getInstance(); |
||
| 101 | $loader->alias('Localisation', \PWWeb\Localisation\Facades\Localisation::class); |
||
| 102 | |||
| 103 | $this->app->singleton( |
||
| 104 | LocalisationRegistrar::class, |
||
| 105 | function ($app) use ($localisationLoader) { |
||
|
|
|||
| 106 | return $localisationLoader; |
||
| 107 | } |
||
| 145 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.