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

CommandServiceProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 60
ccs 0
cts 29
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A provides() 0 7 1
A registerPublishCommand() 0 9 1
A registerSetupCommand() 0 9 1
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