Passed
Push — master ( 546cf1...39ecc9 )
by Yuichi
13:28
created

ValiableServiceProvider::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
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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 1
        ]);
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']);
43 1
        });
44 1
    }
45
46 1
    public function provides()
47
    {
48 1
        return ['sonar_valiable'];
49
    }
50
}
51