CommandServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 82.61%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 60
rs 10
c 0
b 0
f 0
ccs 19
cts 23
cp 0.8261

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\Pages\Providers;
2
3
use Arcanedev\Support\Providers\CommandServiceProvider as ServiceProvider;
4
5
/**
6
 * Class     CommandServiceProvider
7
 *
8
 * @package  Arcanesoft\Pages\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 6
    public function register()
21
    {
22 6
        $this->registerPublishCommand();
23 6
        $this->registerSetupCommand();
24
25 6
        $this->commands($this->commands);
26 6
    }
27
28
    /**
29
     * Get the provided commands.
30
     *
31
     * @return array
32
     */
33
    public function provides()
34
    {
35
        return [
36
            'arcanesoft.pages.commands.publish',
37
            'arcanesoft.pages.commands.setup',
38
        ];
39
    }
40
41
    /* ------------------------------------------------------------------------------------------------
42
 |  Command Functions
43
 | ------------------------------------------------------------------------------------------------
44
 */
45
    /**
46
     * Register the publish command.
47
     */
48 6
    private function registerPublishCommand()
49
    {
50 6
        $this->app->singleton(
51 6
            'arcanesoft.pages.commands.publish',
52 4
            \Arcanesoft\Pages\Console\PublishCommand::class
53 2
        );
54
55 6
        $this->commands[] = \Arcanesoft\Pages\Console\PublishCommand::class;
56 6
    }
57
58
    /**
59
     * Register the setup command.
60
     */
61 6
    private function registerSetupCommand()
62
    {
63 6
        $this->app->singleton(
64 6
            'arcanesoft.pages.commands.setup',
65 4
            \Arcanesoft\Pages\Console\SetupCommand::class
66 2
        );
67
68 6
        $this->commands[] = \Arcanesoft\Pages\Console\SetupCommand::class;
69 6
    }
70
}
71