registerMigrationCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php namespace Wn\Generators;
2
3
use Illuminate\Support\ServiceProvider;
4
5
class CommandsServiceProvider extends ServiceProvider
6
{
7
8
    public function register()
9
    {
10
        $this->registerModelCommand();
11
        $this->registerControllerRestActionsCommand();
12
        $this->registerControllerCommand();
13
        $this->registerRouteCommand();
14
        $this->registerMigrationCommand();
15
        $this->registerResourceCommand();
16
        $this->registerResourcesCommand();
17
        $this->registerPivotTableCommand();
18
        $this->registerFactoryCommand();
19
        // registerSeederCommand
20
        // registerPivotSeederCommand
21
        // registerTestCommand
22
    }
23
24
    protected function registerModelCommand(){
25
        $this->app->singleton('command.wn.model', function($app){
26
            return $app['Wn\Generators\Commands\ModelCommand'];
27
        });
28
        $this->commands('command.wn.model');
29
    }
30
31
    protected function registerControllerRestActionsCommand(){
32
        $this->app->singleton('command.wn.controller.rest-actions', function($app){
33
            return $app['Wn\Generators\Commands\ControllerRestActionsCommand'];
34
        });
35
        $this->commands('command.wn.controller.rest-actions');
36
    }
37
38
    protected function registerControllerCommand(){
39
        $this->app->singleton('command.wn.controller', function($app){
40
            return $app['Wn\Generators\Commands\ControllerCommand'];
41
        });
42
        $this->commands('command.wn.controller');
43
    }
44
45
    protected function registerMigrationCommand(){
46
        $this->app->singleton('command.wn.migration', function($app){
47
            return $app['Wn\Generators\Commands\MigrationCommand'];
48
        });
49
        $this->commands('command.wn.migration');
50
    }
51
52
    protected function registerRouteCommand(){
53
        $this->app->singleton('command.wn.route', function($app){
54
            return $app['Wn\Generators\Commands\RouteCommand'];
55
        });
56
        $this->commands('command.wn.route');
57
    }
58
59
    protected function registerTestCommand(){
60
        $this->app->singleton('command.wn.test', function($app){
61
            return $app['Wn\Generators\Commands\TestCommand'];
62
        });
63
        $this->commands('command.wn.test');
64
    }
65
66
    protected function registerResourceCommand(){
67
        $this->app->singleton('command.wn.resource', function($app){
68
            return $app['Wn\Generators\Commands\ResourceCommand'];
69
        });
70
        $this->commands('command.wn.resource');
71
    }
72
73
    protected function registerResourcesCommand(){
74
        $this->app->singleton('command.wn.resources', function($app){
75
            return $app['Wn\Generators\Commands\ResourcesCommand'];
76
        });
77
        $this->commands('command.wn.resources');
78
    }
79
80
    protected function registerPivotTableCommand(){
81
        $this->app->singleton('command.wn.pivot-table', function($app){
82
            return $app['Wn\Generators\Commands\PivotTableCommand'];
83
        });
84
        $this->commands('command.wn.pivot-table');
85
    }
86
87
    protected function registerFactoryCommand(){
88
        $this->app->singleton('command.wn.factory', function($app){
89
            return $app['Wn\Generators\Commands\FactoryCommand'];
90
        });
91
        $this->commands('command.wn.factory');
92
    }
93
94
    protected function registerSeederCommand(){
95
        $this->app->singleton('command.wn.seeder', function($app){
96
            return $app['Wn\Generators\Commands\SeederCommand'];
97
        });
98
        $this->commands('command.wn.seeder');
99
    }
100
101
    protected function registerPivotSeederCommand(){
102
        $this->app->singleton('command.wn.pivot.seeder', function($app){
103
            return $app['Wn\Generators\Commands\PivotSeederCommand'];
104
        });
105
        $this->commands('command.wn.pivot.seeder');
106
    }
107
108
}
109