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

HasherServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 63
ccs 14
cts 14
cp 1
rs 10
wmc 3
lcom 0
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 11 1
A boot() 0 6 1
A provides() 0 6 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
    /**
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