Completed
Push — master ( 443c70...4b5e2a )
by ARCANEDEV
16:07
created

HasherServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
ccs 4
cts 4
cp 1
crap 1
1
<?php namespace Arcanedev\Hasher;
2
3
use Arcanedev\Support\PackageServiceProvider as ServiceProvider;
4
5
/**
6
 * Class     HasherServiceProvider
7
 *
8
 * @package  Arcanedev\Hasher
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class HasherServiceProvider extends ServiceProvider
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Properties
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Package name.
19
     *
20
     * @var string
21
     */
22
    protected $package = 'hasher';
23
24
    /**
25
     * Indicates if loading of the provider is deferred.
26
     *
27
     * @var bool
28
     */
29
    protected $defer = true;
30
31
    /* ------------------------------------------------------------------------------------------------
32
     |  Getters & Setters
33
     | ------------------------------------------------------------------------------------------------
34
     */
35
    /**
36
     * Get the base path of the package.
37
     *
38
     * @return string
39
     */
40 210
    public function getBasePath()
41
    {
42 210
        return dirname(__DIR__);
43
    }
44
45
    /* ------------------------------------------------------------------------------------------------
46
     |  Main Functions
47
     | ------------------------------------------------------------------------------------------------
48
     */
49
    /**
50
     * Register the service provider.
51
     */
52 210
    public function register()
53
    {
54 210
        $this->registerConfig();
55 210
        $this->registerHasherService();
56 210
    }
57
58
    /**
59
     * Boot the service provider.
60
     */
61 210
    public function boot()
62
    {
63 210
        parent::boot();
64
65 210
        $this->publishConfig();
66 210
    }
67
68
    /**
69
     * Get the services provided by the provider.
70
     *
71
     * @return array
72
     */
73 30
    public function provides()
74
    {
75
        return [
76 30
            Contracts\HashManager::class,
77 10
        ];
78
    }
79
80
    /* ------------------------------------------------------------------------------------------------
81
     |  Service Functions
82
     | ------------------------------------------------------------------------------------------------
83
     */
84
    /**
85
     * Register Hasher service.
86
     */
87 210
    private function registerHasherService()
88
    {
89 210
        $this->singleton(Contracts\HashManager::class, HashManager::class);
90 210
    }
91
}
92