ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 54
ccs 23
cts 23
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A provides() 0 4 1
A __construct() 0 7 1
A boot() 0 10 1
A register() 0 11 1
1
<?php namespace C4tech\RayEmitter;
2
3
use C4tech\RayEmitter\Event\Store;
4
use Illuminate\Support\Facades\App;
5
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
6
7
class ServiceProvider extends BaseServiceProvider
8
{
9
    protected $configPath = '';
10
11
    protected $migrationPath = '';
12
13
    /**
14
     * @inheritDoc
15
     */
16 4
    public function __construct($app)
17
    {
18 4
        $this->configPath = __DIR__ . '/../resources/config.php';
19 4
        $this->migrationPath = __DIR__ . '/../resources/migrations';
20
21 4
        parent::__construct($app);
22 4
    }
23
24
    /**
25
     * @inheritDoc
26
     */
27 1
    public function boot()
28
    {
29 1
        $configs = [];
30 1
        $configs[$this->configPath] = config_path('ray_emitter.php');
31 1
        $this->publishes($configs, 'config');
32
33 1
        $migrations = [];
34 1
        $migrations[$this->migrationPath] = database_path('migrations');
35 1
        $this->publishes($migrations, 'migrations');
36 1
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41 1
    public function register()
42
    {
43 1
        $this->mergeConfigFrom($this->configPath, 'ray_emitter');
44
45 1
        App::singleton(
46 1
            'rayemitter.store',
47 1
            function () {
48 1
                return new Store;
49
            }
50 1
        );
51 1
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56 1
    public function provides()
57
    {
58 1
        return ['rayemitter.store'];
59
    }
60
}
61