Completed
Push — master ( cf2e2e...a40fc9 )
by ARCANEDEV
02:34
created

SettingsServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 88.24%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 75
ccs 15
cts 17
cp 0.8824
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getBasePath() 0 4 1
A register() 0 12 1
A boot() 0 4 1
A provides() 0 7 1
1
<?php namespace Arcanedev\Settings;
2
3
use Arcanedev\Support\PackageServiceProvider as ServiceProvider;
4
use Illuminate\Foundation\Application;
5
6
/**
7
 * Class     SettingsServiceProvider
8
 *
9
 * @package  Arcanedev\Settings
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class SettingsServiceProvider extends ServiceProvider
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * Vendor name.
20
     *
21
     * @var string
22
     */
23
    protected $vendor  = 'arcanedev';
24
25
    /**
26
     * Package name.
27
     *
28
     * @var string
29
     */
30
    protected $package = 'settings';
31
32
    /* ------------------------------------------------------------------------------------------------
33
     |  Getters & Setters
34
     | ------------------------------------------------------------------------------------------------
35
     */
36
    /**
37
     * Get the base path of the package.
38
     *
39
     * @return string
40
     */
41 87
    public function getBasePath()
42
    {
43 87
        return dirname(__DIR__);
44
    }
45
46
    /* ------------------------------------------------------------------------------------------------
47
     |  Main Functions
48
     | ------------------------------------------------------------------------------------------------
49
     */
50
    /**
51
     * Register the service provider.
52
     */
53 87
    public function register()
54
    {
55 87
        $this->registerConfig();
56
57
        $this->singleton('arcanedev.settings.manager', function($app) {
58
            return new SettingsManager($app);
59 87
        });
60
61 87
        $this->app->bind('arcanedev.settings.store', function(Application $app) {
62
            return $app->make('arcanedev.settings.manager')->driver();
63 87
        });
64 87
    }
65
66
    /**
67
     * Boot the service provider.
68
     */
69 87
    public function boot()
70
    {
71 87
        parent::boot();
72 87
    }
73
74
    /**
75
     * Get the services provided by the provider.
76
     *
77
     * @return array
78
     */
79 3
    public function provides()
80
    {
81
        return [
82 3
            'arcanedev.settings.manager',
83 3
            'arcanedev.settings.store',
84 3
        ];
85
    }
86
}
87