Passed
Push — master ( 9e2c82...127f83 )
by Richard
17:06 queued 13:13
created

ArtomatorServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
c 2
b 0
f 0
dl 0
loc 18
rs 9.9
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\RoutesGeneratorCommand;
28
use PWWEB\Artomator\Commands\Scaffold\ScaffoldGeneratorCommand;
29
use PWWEB\Artomator\Commands\Scaffold\ViewsGeneratorCommand;
30
31
class ArtomatorServiceProvider extends ServiceProvider
32
{
33
    /**
34
     * Bootstrap the application services.
35
     *
36
     * @return void
37
     */
38
    public function boot()
39
    {
40
        $configPath = __DIR__.'/../config/artomator.php';
41
        $configPathInfyom = __DIR__.'/../../../infyomlabs/laravel-generator/config/laravel_generator.php';
42
        $schemaPath = __DIR__.'/../../../nuwave/lighthouse/assets/default-schema.graphql';
43
        $configPathNuwave = __DIR__.'/../../../nuwave/lighthouse/src/lighthouse.php';
44
45
        $this->publishes(
46
            [
47
                $configPath       => config_path('pwweb/artomator.php'),
48
                $configPathInfyom => config_path('infyom/laravel_generator.php'),
49
                $configPathNuwave => config_path('lighthouse.php'),
50
                $schemaPath       => config('lighthouse.schema.register', base_path('graphql/schema.graphql')),
51
            ],
52
            'artomator'
53
        );
54
55
        parent::boot();
56
    }
57
58
    /**
59
     * Register the application services.
60
     *
61
     * @return void
62
     */
63
    public function register()
64
    {
65
        $this->app->singleton(
66
            'artomator.publish',
67
            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

67
            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...
68
                return new GeneratorPublishCommand();
69
            }
70
        );
71
72
        $this->app->singleton(
73
            'artomator.api',
74
            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
            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 APIGeneratorCommand();
76
            }
77
        );
78
79
        $this->app->singleton(
80
            'artomator.scaffold',
81
            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

81
            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...
82
                return new ScaffoldGeneratorCommand();
83
            }
84
        );
85
86
        $this->app->singleton(
87
            'artomator.publish.layout',
88
            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

88
            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...
89
                return new LayoutPublishCommand();
90
            }
91
        );
92
93
        $this->app->singleton(
94
            'artomator.publish.templates',
95
            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

95
            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...
96
                return new PublishTemplateCommand();
97
            }
98
        );
99
100
        $this->app->singleton(
101
            'artomator.api_scaffold',
102
            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
            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 APIScaffoldGeneratorCommand();
104
            }
105
        );
106
107
        $this->app->singleton(
108
            'artomator.migration',
109
            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

109
            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...
110
                return new MigrationGeneratorCommand();
111
            }
112
        );
113
114
        $this->app->singleton(
115
            'artomator.model',
116
            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

116
            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...
117
                return new ModelGeneratorCommand();
118
            }
119
        );
120
121
        $this->app->singleton(
122
            'artomator.repository',
123
            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

123
            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...
124
                return new RepositoryGeneratorCommand();
125
            }
126
        );
127
128
        $this->app->singleton(
129
            'artomator.api.controller',
130
            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
            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 APIControllerGeneratorCommand();
132
            }
133
        );
134
135
        $this->app->singleton(
136
            'artomator.api.requests',
137
            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

137
            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...
138
                return new APIRequestsGeneratorCommand();
139
            }
140
        );
141
142
        $this->app->singleton(
143
            'artomator.api.tests',
144
            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

144
            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...
145
                return new TestsGeneratorCommand();
146
            }
147
        );
148
149
        $this->app->singleton(
150
            'artomator.scaffold.controller',
151
            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

151
            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...
152
                return new ControllerGeneratorCommand();
153
            }
154
        );
155
156
        $this->app->singleton(
157
            'artomator.scaffold.requests',
158
            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

158
            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...
159
                return new RequestsGeneratorCommand();
160
            }
161
        );
162
163
        $this->app->singleton(
164
            'artomator.scaffold.views',
165
            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

165
            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...
166
                return new ViewsGeneratorCommand();
167
            }
168
        );
169
170
        $this->app->singleton(
171
            'artomator.scaffold.routes',
172
            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

172
            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...
173
                return new RoutesGeneratorCommand();
174
            }
175
        );
176
177
        $this->app->singleton(
178
            'artomator.rollback',
179
            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

179
            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...
180
                return new RollbackGeneratorCommand();
181
            }
182
        );
183
184
        $this->app->singleton(
185
            'artomator.publish.user',
186
            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

186
            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...
187
                return new PublishUserCommand();
188
            }
189
        );
190
191
        $this->app->singleton(
192
            'artomator.graphql',
193
            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

193
            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...
194
                return new GraphQLGeneratorCommand();
195
            }
196
        );
197
198
        $this->app->singleton(
199
            'artomator.graphql_scaffold',
200
            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

200
            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...
201
                return new GraphQLScaffoldGeneratorCommand();
202
            }
203
        );
204
205
        $this->app->singleton(
206
            'artomator.graphql.query',
207
            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

207
            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...
208
                return new GraphQLQueryGeneratorCommand();
209
            }
210
        );
211
212
        $this->app->singleton(
213
            'artomator.graphql.mutations',
214
            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

214
            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...
215
                return new GraphQLMutationsGeneratorCommand();
216
            }
217
        );
218
219
        $this->app->singleton(
220
            'artomator.graphql.type',
221
            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

221
            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...
222
                return new GraphQLTypeGeneratorCommand();
223
            }
224
        );
225
226
        $this->app->singleton(
227
            'artomator.graphql.subscription',
228
            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

228
            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...
229
                return new GraphQLSubscriptionGeneratorCommand();
230
            }
231
        );
232
233
        parent::register();
234
235
        $this->commands(
236
            [
237
                'artomator.publish',
238
                'artomator.api',
239
                'artomator.scaffold',
240
                'artomator.api_scaffold',
241
                'artomator.publish.layout',
242
                'artomator.publish.templates',
243
                'artomator.migration',
244
                'artomator.model',
245
                'artomator.repository',
246
                'artomator.api.controller',
247
                'artomator.api.requests',
248
                'artomator.api.tests',
249
                'artomator.scaffold.controller',
250
                'artomator.scaffold.requests',
251
                'artomator.scaffold.views',
252
                'artomator.scaffold.routes',
253
                'artomator.rollback',
254
                'artomator.publish.user',
255
                'artomator.graphql',
256
                'artomator.graphql_scaffold',
257
                'artomator.graphql.query',
258
                'artomator.graphql.mutations',
259
                'artomator.graphql.type',
260
                'artomator.graphql.subscription',
261
            ]
262
        );
263
    }
264
}
265