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

ServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 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