MetricServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
A boot() 0 6 2
A provides() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\LaravelMetrics;
6
7
use Arcanedev\LaravelMetrics\Contracts\Manager as ManagerContract;
8
use Arcanedev\Support\Providers\PackageServiceProvider;
9
use Illuminate\Contracts\Support\DeferrableProvider;
10
11
/**
12
 * Class     MetricServiceProvider
13
 *
14
 * @author   ARCANEDEV <[email protected]>
15
 */
16
class MetricServiceProvider extends PackageServiceProvider implements DeferrableProvider
17
{
18
    /* -----------------------------------------------------------------
19
     |  Properties
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Package name.
25
     *
26
     * @var string
27
     */
28
    protected $package = 'metrics';
29
30
    /* -----------------------------------------------------------------
31
     |  Main Methods
32
     | -----------------------------------------------------------------
33
     */
34
35
    /**
36
     * Register the service provider.
37
     */
38 568
    public function register(): void
39
    {
40 568
        parent::register();
41
42 568
        $this->registerConfig();
43
44 284
        $this->singleton(ManagerContract::class, Manager::class);
45 568
    }
46
47
    /**
48
     * Boot the service provider.
49
     */
50 568
    public function boot(): void
51
    {
52 568
        if ($this->app->runningInConsole()) {
53 568
            $this->publishConfig();
54
        }
55 568
    }
56
57
    /**
58
     * Get the services provided by the provider.
59
     *
60
     * @return array
61
     */
62 4
    public function provides(): array
63
    {
64
        return [
65 4
            ManagerContract::class,
66
        ];
67
    }
68
}
69