HasherServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
A boot() 0 6 2
A provides() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\Hasher;
6
7
use Arcanedev\Hasher\Contracts\HashManager as HashManagerContract;
8
use Arcanedev\Support\Providers\PackageServiceProvider as ServiceProvider;
9
use Illuminate\Contracts\Support\DeferrableProvider;
10
11
/**
12
 * Class     HasherServiceProvider
13
 *
14
 * @package  Arcanedev\Hasher
15
 * @author   ARCANEDEV <[email protected]>
16
 */
17
class HasherServiceProvider extends ServiceProvider implements DeferrableProvider
18
{
19
    /* -----------------------------------------------------------------
20
     |  Properties
21
     | -----------------------------------------------------------------
22
     */
23
24
    /**
25
     * Package name.
26
     *
27
     * @var string
28
     */
29
    protected $package = 'hasher';
30
31
    /* -----------------------------------------------------------------
32
     |  Main Methods
33
     | -----------------------------------------------------------------
34
     */
35
36
    /**
37
     * Register the service provider.
38
     */
39 84
    public function register(): void
40
    {
41 84
        parent::register();
42
43 84
        $this->registerConfig();
44
45 84
        $this->singleton(HashManagerContract::class, HashManager::class);
46 84
    }
47
48
    /**
49
     * Boot the service provider.
50
     */
51 84
    public function boot(): void
52
    {
53 84
        if ($this->app->runningInConsole()) {
54 84
            $this->publishConfig();
55
        }
56 84
    }
57
58
    /**
59
     * Get the services provided by the provider.
60
     *
61
     * @return array
62
     */
63 12
    public function provides(): array
64
    {
65
        return [
66 12
            HashManagerContract::class,
67
        ];
68
    }
69
}
70