Completed
Push — master ( 3cd9a5...983ab2 )
by ARCANEDEV
03:07
created

CommandServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Blog\Providers;
2
3
use Arcanedev\Support\Providers\CommandServiceProvider as ServiceProvider;
4
5
/**
6
 * Class     CommandServiceProvider
7
 *
8
 * @package  Arcanesoft\Blog\Providers
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CommandServiceProvider extends ServiceProvider
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Register the service provider.
19
     */
20
    public function register()
21
    {
22
        $this->registerPublishCommand();
23
        $this->registerSetupCommand();
24
25
        $this->commands($this->commands);
26
    }
27
28
    /**
29
     * Get the provided commands.
30
     *
31
     * @return array
32
     */
33
    public function provides()
34
    {
35
        return [
36
            'arcanesoft.blog.commands.publish',
37
            'arcanesoft.blog.commands.setup',
38
        ];
39
    }
40
41
    /* ------------------------------------------------------------------------------------------------
42
     |  Command Functions
43
     | ------------------------------------------------------------------------------------------------
44
     */
45
    /**
46
     * Register the publish command.
47
     */
48
    private function registerPublishCommand()
49
    {
50
        $this->app->singleton(
51
            'arcanesoft.blog.commands.publish',
52
            \Arcanesoft\Blog\Console\PublishCommand::class
53
        );
54
55
        $this->commands[] = \Arcanesoft\Blog\Console\PublishCommand::class;
56
    }
57
58
    /**
59
     * Register the setup command.
60
     */
61
    private function registerSetupCommand()
62
    {
63
        $this->app->singleton(
64
            'arcanesoft.blog.commands.setup',
65
            \Arcanesoft\Blog\Console\SetupCommand::class
66
        );
67
68
        $this->commands[] = \Arcanesoft\Blog\Console\SetupCommand::class;
69
    }
70
}
71