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

SettingsServiceProvider::getBasePath()   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
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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