Completed
Pull Request — master (#8)
by ARCANEDEV
03:39
created

HasherServiceProvider::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
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
    /**
19
     * Package name.
20
     *
21
     * @var string
22
     */
23
    protected $package = 'hasher';
24
25
    /**
26
     * Indicates if loading of the provider is deferred.
27
     *
28
     * @var bool
29
     */
30
    protected $defer = true;
31
32
    /* -----------------------------------------------------------------
33
     |  Main Methods
34
     | -----------------------------------------------------------------
35
     */
36
37
    /**
38
     * Register the service provider.
39
     */
40 42
    public function register()
41
    {
42 42
        parent::register();
43
44 42
        $this->registerConfig();
45
46
        // Services
47 42
        $this->singleton(Contracts\HashManager::class, function ($app) {
48 30
            return new HashManager($app);
49 42
        });
50 42
    }
51
52
    /**
53
     * Boot the service provider.
54
     */
55 42
    public function boot()
56
    {
57 42
        parent::boot();
58
59 42
        $this->publishConfig();
60 42
    }
61
62
    /**
63
     * Get the services provided by the provider.
64
     *
65
     * @return array
66
     */
67 6
    public function provides()
68
    {
69
        return [
70 6
            Contracts\HashManager::class,
71 2
        ];
72
    }
73
}
74