ServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace GDCInfo;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 8
    public function boot(): void
8
    {
9 8
        if ($this->app->runningInConsole()) {
10 8
            $this->publishes([
11 8
                __DIR__ . '/../config/gdc-info.php' => config_path('gdc-info.php'),
12 8
            ], 'config');
13
14
        }
15
16 8
        $this->commands([
17
18 8
        ]);
19
    }
20
21 8
    public function register(): void
22
    {
23 8
        $this->mergeConfigFrom(__DIR__ . '/../config/gdc-info.php', 'gdc-info');
24
25 8
        $this->app->singleton('gdc-info-manager', 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

25
        $this->app->singleton('gdc-info-manager', 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...
26 2
            return new GDCInfoManager;
27 8
        });
28
    }
29
}
30