Completed
Push — master ( f3b490...997e8b )
by Stanislav
03:32
created

ServerTimingServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DJStarCOM\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
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
            return new ServerTiming(new \Symfony\Component\Stopwatch\Stopwatch());
26
        });
27
    }
28
29
    /**
30
     * Register config publisher
31
     */
32
    protected function registerPublishing()
33
    {
34
        $this->publishes([
35
            __DIR__.'/config/config.php' => config_path('timing.php'),
36
        ], 'server-timing-config');
37
    }
38
}
39