Passed
Push — master ( 9de3df...49c81a )
by Richard
11:22 queued 11s
created

ArtomatorServiceProvider::bootForConsole()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 43
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
eloc 14
c 5
b 0
f 0
dl 0
loc 43
rs 9.7998
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PWWEB\Artomator;
4
5
use InfyOm\Generator\InfyOmGeneratorServiceProvider as ServiceProvider;
6
use PWWEB\Artomator\Commands\API\APIControllerGeneratorCommand;
7
use PWWEB\Artomator\Commands\API\APIGeneratorCommand;
8
use PWWEB\Artomator\Commands\API\APIRequestsGeneratorCommand;
9
use PWWEB\Artomator\Commands\API\TestsGeneratorCommand;
10
use PWWEB\Artomator\Commands\APIScaffoldGeneratorCommand;
11
use PWWEB\Artomator\Commands\Common\MigrationGeneratorCommand;
12
use PWWEB\Artomator\Commands\Common\ModelGeneratorCommand;
13
use PWWEB\Artomator\Commands\Common\RepositoryGeneratorCommand;
14
use PWWEB\Artomator\Commands\GraphQL\GraphQLGeneratorCommand;
15
use PWWEB\Artomator\Commands\GraphQL\GraphQLMutationsGeneratorCommand;
16
use PWWEB\Artomator\Commands\GraphQL\GraphQLQueryGeneratorCommand;
17
use PWWEB\Artomator\Commands\GraphQL\GraphQLSubscriptionGeneratorCommand;
18
use PWWEB\Artomator\Commands\GraphQL\GraphQLTypeGeneratorCommand;
19
use PWWEB\Artomator\Commands\GraphQLScaffoldGeneratorCommand;
20
use PWWEB\Artomator\Commands\Publish\GeneratorPublishCommand;
21
use PWWEB\Artomator\Commands\Publish\LayoutPublishCommand;
22
use PWWEB\Artomator\Commands\Publish\PublishTemplateCommand;
23
use PWWEB\Artomator\Commands\Publish\PublishUserCommand;
24
use PWWEB\Artomator\Commands\RollbackGeneratorCommand;
25
use PWWEB\Artomator\Commands\Scaffold\ControllerGeneratorCommand;
26
use PWWEB\Artomator\Commands\Scaffold\RequestsGeneratorCommand;
27
use PWWEB\Artomator\Commands\Scaffold\ScaffoldGeneratorCommand;
28
use PWWEB\Artomator\Commands\Scaffold\ViewsGeneratorCommand;
29
30
class ArtomatorServiceProvider extends ServiceProvider
31
{
32
    /**
33
     * Bootstrap the application services.
34
     *
35
     * @return void
36
     */
37
    public function boot()
38
    {
39
        $configPath = __DIR__.'/../config/artomator.php';
40
        $configPathInfyom = __DIR__.'/../../../infyomlabs/laravel-generator/config/laravel_generator.php';
41
        $schemaPath = __DIR__.'/../../../nuwave/lighthouse/assets/default-schema.graphql';
42
        $configPathNuwave = __DIR__.'/../../../nuwave/lighthouse/src/lighthouse.php';
43
44
        $this->publishes(
45
            [
46
                $configPath       => config_path('pwweb/artomator.php'),
47
                $configPathInfyom => config_path('infyom/laravel_generator.php'),
48
                $configPathNuwave => config_path('lighthouse.php'),
49
                $schemaPath       => config('lighthouse.schema.register', base_path('graphql/schema.graphql')),
50
            ],
51
            'artomator'
52
        );
53
54
        parent::boot();
55
    }
56
57
    /**
58
     * Register the application services.
59
     */
60
    public function register()
61
    {
62
        $this->app->singleton('artomator.publish', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

62
        $this->app->singleton('artomator.publish', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
            return new GeneratorPublishCommand();
64
        });
65
66
        $this->app->singleton('artomator.api', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

66
        $this->app->singleton('artomator.api', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
67
            return new APIGeneratorCommand();
68
        });
69
70
        $this->app->singleton('artomator.scaffold', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

70
        $this->app->singleton('artomator.scaffold', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
71
            return new ScaffoldGeneratorCommand();
72
        });
73
74
        $this->app->singleton('artomator.publish.layout', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

74
        $this->app->singleton('artomator.publish.layout', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
            return new LayoutPublishCommand();
76
        });
77
78
        $this->app->singleton('artomator.publish.templates', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

78
        $this->app->singleton('artomator.publish.templates', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
79
            return new PublishTemplateCommand();
80
        });
81
82
        $this->app->singleton('artomator.api_scaffold', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

82
        $this->app->singleton('artomator.api_scaffold', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
83
            return new APIScaffoldGeneratorCommand();
84
        });
85
86
        $this->app->singleton('artomator.migration', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

86
        $this->app->singleton('artomator.migration', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
87
            return new MigrationGeneratorCommand();
88
        });
89
90
        $this->app->singleton('artomator.model', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

90
        $this->app->singleton('artomator.model', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
91
            return new ModelGeneratorCommand();
92
        });
93
94
        $this->app->singleton('artomator.repository', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

94
        $this->app->singleton('artomator.repository', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
95
            return new RepositoryGeneratorCommand();
96
        });
97
98
        $this->app->singleton('artomator.api.controller', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

98
        $this->app->singleton('artomator.api.controller', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
99
            return new APIControllerGeneratorCommand();
100
        });
101
102
        $this->app->singleton('artomator.api.requests', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

102
        $this->app->singleton('artomator.api.requests', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
103
            return new APIRequestsGeneratorCommand();
104
        });
105
106
        $this->app->singleton('artomator.api.tests', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

106
        $this->app->singleton('artomator.api.tests', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
107
            return new TestsGeneratorCommand();
108
        });
109
110
        $this->app->singleton('artomator.scaffold.controller', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

110
        $this->app->singleton('artomator.scaffold.controller', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
111
            return new ControllerGeneratorCommand();
112
        });
113
114
        $this->app->singleton('artomator.scaffold.requests', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

114
        $this->app->singleton('artomator.scaffold.requests', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
115
            return new RequestsGeneratorCommand();
116
        });
117
118
        $this->app->singleton('artomator.scaffold.views', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

118
        $this->app->singleton('artomator.scaffold.views', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
119
            return new ViewsGeneratorCommand();
120
        });
121
122
        $this->app->singleton('artomator.rollback', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

122
        $this->app->singleton('artomator.rollback', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
123
            return new RollbackGeneratorCommand();
124
        });
125
126
        $this->app->singleton('artomator.publish.user', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

126
        $this->app->singleton('artomator.publish.user', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
127
            return new PublishUserCommand();
128
        });
129
130
        $this->app->singleton('artomator.graphql', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

130
        $this->app->singleton('artomator.graphql', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
131
            return new GraphQLGeneratorCommand();
132
        });
133
134
        $this->app->singleton('artomator.graphql_scaffold', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

134
        $this->app->singleton('artomator.graphql_scaffold', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
135
            return new GraphQLScaffoldGeneratorCommand();
136
        });
137
138
        $this->app->singleton('artomator.graphql.query', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

138
        $this->app->singleton('artomator.graphql.query', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
139
            return new GraphQLQueryGeneratorCommand();
140
        });
141
142
        $this->app->singleton('artomator.graphql.mutations', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

142
        $this->app->singleton('artomator.graphql.mutations', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
143
            return new GraphQLMutationsGeneratorCommand();
144
        });
145
146
        $this->app->singleton('artomator.graphql.type', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

146
        $this->app->singleton('artomator.graphql.type', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
147
            return new GraphQLTypeGeneratorCommand();
148
        });
149
150
        $this->app->singleton('artomator.graphql.subscription', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

150
        $this->app->singleton('artomator.graphql.subscription', function (/** @scrutinizer ignore-unused */ $app) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
151
            return new GraphQLSubscriptionGeneratorCommand();
152
        });
153
154
        parent::register();
155
156
        $this->commands(
157
            [
158
                'artomator.publish',
159
                'artomator.api',
160
                'artomator.scaffold',
161
                'artomator.api_scaffold',
162
                'artomator.publish.layout',
163
                'artomator.publish.templates',
164
                'artomator.migration',
165
                'artomator.model',
166
                'artomator.repository',
167
                'artomator.api.controller',
168
                'artomator.api.requests',
169
                'artomator.api.tests',
170
                'artomator.scaffold.controller',
171
                'artomator.scaffold.requests',
172
                'artomator.scaffold.views',
173
                'artomator.rollback',
174
                'artomator.publish.user',
175
                'artomator.graphql',
176
                'artomator.graphql_scaffold',
177
                'artomator.graphql.query',
178
                'artomator.graphql.mutations',
179
                'artomator.graphql.type',
180
                'artomator.graphql.subscription',
181
            ]
182
        );
183
    }
184
}
185