ServerTimingServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
        $this->app->singleton(ServerTiming::class, function (/** @scrutinizer ignore-unused */ $app) {

This check looks for 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
    protected function registerPublishing()
30
    {
31
        $this->publishes([
32
            __DIR__.'/config/config.php' => config_path('timing.php'),
33
        ], 'server-timing-config');
34
    }
35
}
36