ServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 22
c 0
b 0
f 0
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A boot() 0 10 2
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