Completed
Push — master ( e000b3...b0a3db )
by Christopher
06:52 queued 48s
created

ServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A boot() 0 6 1
A register() 0 11 1
A provides() 0 4 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
    /**
12
     * @inheritDoc
13
     */
14 4
    public function __construct($app)
15
    {
16 4
        $this->configPath = __DIR__ . '/../resources/config.php';
17 4
        parent::__construct($app);
18 4
    }
19
20
    /**
21
     * @inheritDoc
22
     */
23 1
    public function boot()
24
    {
25 1
        $configs = [];
26 1
        $configs[$this->configPath] = config_path('ray_emitter.php');
27 1
        $this->publishes($configs);
28 1
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33 1
    public function register()
34
    {
35 1
        $this->mergeConfigFrom($this->configPath, 'ray_emitter');
36
37 1
        App::singleton(
38 1
            'rayemitter.store',
39 1
            function () {
40 1
                return new Store;
41
            }
42 1
        );
43 1
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48 1
    public function provides()
49
    {
50 1
        return ['rayemitter.store'];
51
    }
52
}
53