beyondcode /
laravel-server-timing
| 1 | <?php |
||
| 2 | |||
| 3 | namespace BeyondCode\ServerTiming; |
||
| 4 | |||
| 5 | use Illuminate\Support\ServiceProvider; |
||
| 6 | |||
| 7 | class ServerTimingServiceProvider extends ServiceProvider |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Bootstrap the application services. |
||
| 11 | */ |
||
| 12 | public function boot() |
||
| 13 | { |
||
| 14 | if ($this->app->runningInConsole()) { |
||
| 15 | $this->registerPublishing(); |
||
| 16 | } |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Register the application services. |
||
| 21 | */ |
||
| 22 | public function register() |
||
| 23 | { |
||
| 24 | $this->app->singleton(ServerTiming::class, function ($app) { |
||
|
0 ignored issues
–
show
|
|||
| 25 | return new ServerTiming(new \Symfony\Component\Stopwatch\Stopwatch()); |
||
| 26 | }); |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function registerPublishing() |
||
| 30 | { |
||
| 31 | $this->publishes([ |
||
| 32 | __DIR__.'/config/config.php' => config_path('timing.php'), |
||
| 33 | ], 'server-timing-config'); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.