Completed
Push — master ( a0f59b...05c571 )
by Elf
05:11
created

ConsoleServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 47
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 20 1
A provides() 0 8 1
1
<?php
2
3
namespace App\Support\Providers;
4
5
use App\Support\Console\Commands\ApiTokenKey;
6
use App\Support\Console\Commands\AssetsVersion;
7
use App\Support\Console\Commands\Int2stringCharacters;
8
use Illuminate\Support\ServiceProvider;
9
10
class ConsoleServiceProvider extends ServiceProvider
11
{
12
    /**
13
     * Indicates if loading of the provider is deferred.
14
     *
15
     * @var bool
16
     */
17
    protected $defer = true;
18
19
    /**
20
     * Register the service provider.
21
     */
22 1
    public function register()
23
    {
24
        $this->app->singleton('command.api.token-key', function () {
25
            return new ApiTokenKey;
26 1
        });
27
28
        $this->app->singleton('command.assets.version', function () {
29
            return new AssetsVersion;
30 1
        });
31
32 1
        $this->app->singleton('command.int2string.characters', function () {
33
            return new Int2stringCharacters;
34 1
        });
35
36 1
        $this->commands(
37 1
            'command.api.token-key',
38 1
            'command.assets.version',
39 1
            'command.int2string.characters'
40
        );
41 1
    }
42
43
    /**
44
     * Get the services provided by the provider.
45
     *
46
     * @return array
47
     */
48
    public function provides()
49
    {
50
        return [
51
            'command.api.token-key',
52
            'command.assets.version',
53
            'command.int2string.characters',
54
        ];
55
    }
56
}
57