Completed
Pull Request — master (#8)
by ARCANEDEV
19:21
created

UnitsServiceProvider::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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php namespace Arcanedev\Units;
2
3
use Arcanedev\Support\PackageServiceProvider;
4
5
/**
6
 * Class     UnitsServiceProvider
7
 *
8
 * @package  Arcanedev\Units
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class UnitsServiceProvider extends PackageServiceProvider
12
{
13
    /* -----------------------------------------------------------------
14
     |  Properties
15
     | -----------------------------------------------------------------
16
     */
17
    /**
18
     * Package name.
19
     *
20
     * @var string
21
     */
22
    protected $package = 'units';
23
24
    /**
25
     * Indicates if loading of the provider is deferred.
26
     *
27
     * @var bool
28
     */
29
    protected $defer = true;
30
31
    /* -----------------------------------------------------------------
32
     |  Main Methods
33
     | -----------------------------------------------------------------
34
     */
35
    /**
36
     * Register the service provider.
37
     */
38
    public function register()
39
    {
40 558
        parent::register();
41
42 558
        $this->registerConfig();
43
        $this->registerManager();
44
    }
45
46
    /**
47
     * Boot the service provider.
48
     */
49
    public function boot()
50
    {
51
        parent::boot();
52 558
53
        $this->publishConfig();
54 558
    }
55 558
56 558
    /**
57
     * Get the services provided by the provider.
58
     *
59
     * @return array
60
     */
61 558
    public function provides()
62
    {
63 558
        return [
64
            Contracts\UnitsManager::class,
65 558
        ];
66 558
    }
67
68
    /* -----------------------------------------------------------------
69
     |  Other Methods
70
     | -----------------------------------------------------------------
71
     */
72
    /**
73 18
     * Register the Units Manager.
74
     */
75
    private function registerManager()
76 18
    {
77 6
        $this->singleton(Contracts\UnitsManager::class, function ($app) {
78 6
            return new UnitsManager($app);
79
        });
80
    }
81
}
82