Completed
Push — master ( 781e67...97b0c3 )
by Nicolas
08:36 queued 05:48
created

ConsoleServiceProvider::provides()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 10
ccs 0
cts 0
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Nwidart\Modules\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Nwidart\Modules\Commands\CommandCommand;
7
use Nwidart\Modules\Commands\ControllerCommand;
8
use Nwidart\Modules\Commands\DisableCommand;
9
use Nwidart\Modules\Commands\DumpCommand;
10
use Nwidart\Modules\Commands\EnableCommand;
11
use Nwidart\Modules\Commands\GenerateEventCommand;
12
use Nwidart\Modules\Commands\GenerateJobCommand;
13
use Nwidart\Modules\Commands\GenerateListenerCommand;
14
use Nwidart\Modules\Commands\GenerateMiddlewareCommand;
15
use Nwidart\Modules\Commands\GenerateProviderCommand;
16
use Nwidart\Modules\Commands\GenerateRouteProviderCommand;
17
use Nwidart\Modules\Commands\InstallCommand;
18
use Nwidart\Modules\Commands\ListCommand;
19
use Nwidart\Modules\Commands\MakeCommand;
20
use Nwidart\Modules\Commands\MakeRequestCommand;
21
use Nwidart\Modules\Commands\MigrateCommand;
22
use Nwidart\Modules\Commands\MigrateRefreshCommand;
23
use Nwidart\Modules\Commands\MigrateResetCommand;
24
use Nwidart\Modules\Commands\MigrateRollbackCommand;
25
use Nwidart\Modules\Commands\MigrationCommand;
26
use Nwidart\Modules\Commands\ModelCommand;
27
use Nwidart\Modules\Commands\PublishCommand;
28
use Nwidart\Modules\Commands\PublishConfigurationCommand;
29
use Nwidart\Modules\Commands\PublishMigrationCommand;
30
use Nwidart\Modules\Commands\PublishTranslationCommand;
31
use Nwidart\Modules\Commands\SeedCommand;
32
use Nwidart\Modules\Commands\SeedMakeCommand;
33
use Nwidart\Modules\Commands\SetupCommand;
34
use Nwidart\Modules\Commands\UpdateCommand;
35
use Nwidart\Modules\Commands\UseCommand;
36
37
class ConsoleServiceProvider extends ServiceProvider
38
{
39
    protected $defer = false;
40
41
    /**
42
     * The available commands
43
     *
44
     * @var array
45
     */
46
    protected $commands = [
47
        MakeCommand::class,
48
        CommandCommand::class,
49
        ControllerCommand::class,
50
        DisableCommand::class,
51
        EnableCommand::class,
52
        GenerateEventCommand::class,
53
        GenerateListenerCommand::class,
54
        GenerateMiddlewareCommand::class,
55
        GenerateProviderCommand::class,
56
        GenerateRouteProviderCommand::class,
57
        InstallCommand::class,
58
        ListCommand::class,
59
        MigrateCommand::class,
60
        MigrateRefreshCommand::class,
61
        MigrateResetCommand::class,
62
        MigrateRollbackCommand::class,
63
        MigrationCommand::class,
64
        ModelCommand::class,
65
        PublishCommand::class,
66
        PublishMigrationCommand::class,
67
        PublishTranslationCommand::class,
68
        SeedCommand::class,
69
        SeedMakeCommand::class,
70
        SetupCommand::class,
71
        UpdateCommand::class,
72
        UseCommand::class,
73
        DumpCommand::class,
74
        MakeRequestCommand::class,
75
        PublishConfigurationCommand::class,
76
        GenerateJobCommand::class,
77
    ];
78
79
    /**
80
     * Register the commands.
81
     */
82 76
    public function register()
83
    {
84 76
        foreach ($this->commands as $command) {
85 76
            $this->commands($command);
86
        }
87 76
    }
88
89
    /**
90
     * @return array
91
     */
92
    public function provides()
93
    {
94
        $provides = [];
95
96
        foreach ($this->commands as $command) {
97
            $provides[] = $command;
98
        }
99
100
        return $provides;
101
    }
102
}
103