Completed
Push — master ( b3f467...3d5acc )
by Elf
05:46
created

ConsoleServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
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