PacServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 8 2
A register() 0 10 1
A provides() 0 4 1
1
<?php
2
3
namespace FeiMx\Pac;
4
5
use FeiMx\Pac\Contracts\Factory;
6
use Illuminate\Support\ServiceProvider;
7
8
class PacServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     */
13
    public function boot()
14
    {
15
        if ($this->app->runningInConsole()) {
16
            $this->publishes([
17
                __DIR__.'/../config/pac.php' => config_path('pac.php'),
18
            ], 'config');
19
        }
20
    }
21
22
    /**
23
     * Register the application services.
24
     */
25
    public function register()
26
    {
27
        $this->mergeConfigFrom(
28
            __DIR__.'/../config/pac.php', 'pac'
29
        );
30
31
        $this->app->singleton(Factory::class, function ($app) {
32
            return new PacManager($app);
33
        });
34
    }
35
36
    public function provides()
37
    {
38
        return [Factory::class];
39
    }
40
}
41