| Total Complexity | 3 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class RobotsServiceProvider extends ServiceProvider |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Indicates if loading of the provider is deferred. |
||
| 13 | * |
||
| 14 | * @var bool |
||
| 15 | */ |
||
| 16 | protected $defer = false; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Bootstrap services. |
||
| 20 | * |
||
| 21 | * @return void |
||
| 22 | */ |
||
| 23 | public function boot(Filesystem $filesystem) |
||
| 24 | { |
||
| 25 | $this->publishes([ |
||
| 26 | __DIR__ . '/../config/robots.php' => config_path('robots.php'), |
||
| 27 | ], 'config'); |
||
| 28 | |||
| 29 | $this->publishes([ |
||
| 30 | __DIR__ . '/../database/migrations/create_robots_tables.php.stub' => $this->getMigrationFileName($filesystem), |
||
| 31 | ], 'migrations'); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Register the service provider. |
||
| 36 | * |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | public function register() |
||
| 40 | { |
||
| 41 | $this->app->singleton('robots', function ($app) { |
||
|
|
|||
| 42 | return new Robots(); |
||
| 43 | }); |
||
| 44 | |||
| 45 | $this->app->alias('robots', 'Robots\Robots'); |
||
| 46 | |||
| 47 | $this->mergeConfigFrom( |
||
| 48 | __DIR__.'/../config/robots.php', |
||
| 49 | 'robots' |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Returns existing migration file if found, else uses the current timestamp. |
||
| 55 | * |
||
| 56 | * @param Filesystem $filesystem |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | protected function getMigrationFileName(Filesystem $filesystem): string |
||
| 67 | } |
||
| 68 | } |
||
| 69 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.