ValiableServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 92.86%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 44
ccs 13
cts 14
cp 0.9286
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A registerValiableBuilder() 0 6 1
A provides() 0 4 1
A boot() 0 6 1
1
<?php
2
3
namespace Sonar\Valiable;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class ValiableServiceProvider extends ServiceProvider
8
{
9
    protected $commands = [
10
        'Sonar\Valiable\Console\ValiableImportCommand',
11
        'Sonar\Valiable\Console\ValiableListCommand',
12
        'Sonar\Valiable\Console\ValiableClearCommand',
13
    ];
14
15
    /**
16
     * Perform post-registration booting of services.
17
     *
18
     * @return void
19
     */
20 1
    public function boot()
21
    {
22 1
        $this->publishes([
23 1
            __DIR__ . '/../storage/app/sonar_valiables' => storage_path('app/sonar_valiables'),
24
        ]);
25 1
    }
26
27
    /**
28
     * Register any package services.
29
     *
30
     * @return void
31
     */
32 1
    public function register()
33
    {
34 1
        $this->commands($this->commands);
35
36 1
        $this->registerValiableBuilder();
37 1
    }
38
39
    protected function registerValiableBuilder()
40
    {
41 1
        $this->app->singleton('sonar_valiable',function($app) {
42
            return new Valiable($app['cache.store']);
43 1
        });
44 1
    }
45
46 1
    public function provides()
47
    {
48 1
        return ['sonar_valiable'];
49
    }
50
}
51