Passed
Push — master ( 9da6fd...0354d3 )
by Rafael
05:30
created
src/DependencyInjection/Configuration.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -47,24 +47,24 @@  discard block
 block discarded – undo
47 47
     protected function configureErrorHandling(NodeBuilder $root)
48 48
     {
49 49
         $errorHandling = $root->arrayNode('error_handling')
50
-                              ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
51
-                              ->addDefaultsIfNotSet()
52
-                              ->children();
50
+                                ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
51
+                                ->addDefaultsIfNotSet()
52
+                                ->children();
53 53
 
54 54
         $errorHandling->enumNode('validation_messages')
55
-                      ->values(['error', 'payload', 'both'])
56
-                      ->info('Where should be displayed validation messages.')
57
-                      ->defaultValue('error');
55
+                        ->values(['error', 'payload', 'both'])
56
+                        ->info('Where should be displayed validation messages.')
57
+                        ->defaultValue('error');
58 58
 
59 59
         $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultTrue();
60 60
 
61 61
         $errorHandling->scalarNode('formatter')
62
-                      ->info('Formatter is responsible for converting instances of Error to an array')
63
-                      ->defaultValue(DefaultErrorFormatter::class);
62
+                        ->info('Formatter is responsible for converting instances of Error to an array')
63
+                        ->defaultValue(DefaultErrorFormatter::class);
64 64
 
65 65
         $errorHandling->scalarNode('handler')
66
-                      ->info('Handler is useful for error filtering and logging.')
67
-                      ->defaultValue(DefaultErrorHandler::class);
66
+                        ->info('Handler is useful for error filtering and logging.')
67
+                        ->defaultValue(DefaultErrorHandler::class);
68 68
 
69 69
         $controlledErrors = $errorHandling
70 70
             ->arrayNode('controlled_errors')
@@ -150,44 +150,44 @@  discard block
 block discarded – undo
150 150
     protected function configureEndpoints(NodeBuilder $root)
151 151
     {
152 152
         $endpoints = $root->arrayNode('endpoints')
153
-                          ->useAttributeAsKey('name')
154
-                          ->validate()
155
-                          ->ifTrue(
156
-                              function ($v) {
157
-                                  return array_key_exists('default', $v);
158
-                              }
159
-                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
160
-                          ->end()
161
-                          ->arrayPrototype()
162
-                          ->children();
153
+                            ->useAttributeAsKey('name')
154
+                            ->validate()
155
+                            ->ifTrue(
156
+                                function ($v) {
157
+                                    return array_key_exists('default', $v);
158
+                                }
159
+                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
160
+                            ->end()
161
+                            ->arrayPrototype()
162
+                            ->children();
163 163
 
164 164
         $endpoints->arrayNode('roles')
165
-                  ->beforeNormalization()
166
-                  ->ifString()
167
-                  ->then(
168
-                      function ($v) {
169
-                          return preg_split('/\s*,\s*/', $v);
170
-                      }
171
-                  )
172
-                  ->end()
173
-                  ->prototype('scalar')
174
-                  ->end();
165
+                    ->beforeNormalization()
166
+                    ->ifString()
167
+                    ->then(
168
+                        function ($v) {
169
+                            return preg_split('/\s*,\s*/', $v);
170
+                        }
171
+                    )
172
+                    ->end()
173
+                    ->prototype('scalar')
174
+                    ->end();
175 175
 
176 176
         $endpoints->scalarNode('host')->example('^api\.backend\.');
177 177
         $endpoints->scalarNode('path')->example('/backend');
178 178
 
179 179
         $root->arrayNode('endpoint_alias')
180
-             ->info('Use alias to refer to multiple endpoints using only one name')
181
-             ->useAttributeAsKey('name')
182
-             ->beforeNormalization()
183
-             ->ifString()
184
-             ->then(
185
-                 function ($v) {
186
-                     return preg_split('/\s*,\s*/', $v);
187
-                 }
188
-             )
189
-             ->end()
190
-             ->variablePrototype();
180
+                ->info('Use alias to refer to multiple endpoints using only one name')
181
+                ->useAttributeAsKey('name')
182
+                ->beforeNormalization()
183
+                ->ifString()
184
+                ->then(
185
+                    function ($v) {
186
+                        return preg_split('/\s*,\s*/', $v);
187
+                    }
188
+                )
189
+                ->end()
190
+                ->variablePrototype();
191 191
 
192 192
         $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.');
193 193
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children();
199 199
 
200 200
         $graphiql->scalarNode('title')
201
-                 ->defaultValue('GraphQL API Explorer');
201
+                    ->defaultValue('GraphQL API Explorer');
202 202
 
203 203
         $graphiql
204 204
             ->scalarNode('data_warning_message')
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             ->defaultFalse();
227 227
 
228 228
         $authentication->scalarNode('login_message')
229
-                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
229
+                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
230 230
 
231 231
         $authenticationProvider = $authentication->arrayNode('provider')->children();
232 232
 
@@ -235,29 +235,29 @@  discard block
 block discarded – undo
235 235
         $jwtLogin = $jwt->arrayNode('login')->children();
236 236
 
237 237
         $jwtLogin->scalarNode('url')
238
-                 ->info('Route name or URI to make the login process to retrieve the token.')
239
-                 ->isRequired();
238
+                    ->info('Route name or URI to make the login process to retrieve the token.')
239
+                    ->isRequired();
240 240
 
241 241
         $jwtLogin->scalarNode('username_parameter')
242
-                 ->defaultValue('username');
242
+                    ->defaultValue('username');
243 243
 
244 244
         $jwtLogin->scalarNode('username_label')
245
-                 ->defaultValue('Username');
245
+                    ->defaultValue('Username');
246 246
 
247 247
         $jwtLogin->scalarNode('password_parameter')
248
-                 ->defaultValue('password');
248
+                    ->defaultValue('password');
249 249
 
250 250
         $jwtLogin->scalarNode('password_label')
251
-                 ->defaultValue('Password');
251
+                    ->defaultValue('Password');
252 252
 
253 253
         $jwtLogin->enumNode('parameters_in')
254
-                 ->values(['form', 'query', 'header'])
255
-                 ->info('How pass parameters to request the token')
256
-                 ->defaultValue('form');
254
+                    ->values(['form', 'query', 'header'])
255
+                    ->info('How pass parameters to request the token')
256
+                    ->defaultValue('form');
257 257
 
258 258
         $jwtLogin->scalarNode('response_token_path')
259
-                 ->defaultValue('token')
260
-                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
259
+                    ->defaultValue('token')
260
+                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
261 261
 
262 262
         $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children();
263 263
 
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
                     ->info('Customize how the token should be send,  use the place holder {token} to replace for current token');
276 276
 
277 277
         $authenticationProvider->scalarNode('custom')
278
-                               ->defaultNull()
279
-                               ->info('Configure custom service to use as authentication provider');
278
+                                ->defaultNull()
279
+                                ->info('Configure custom service to use as authentication provider');
280 280
     }
281 281
 
282 282
     protected function configureCORS(NodeBuilder $root)
@@ -299,25 +299,25 @@  discard block
 block discarded – undo
299 299
     {
300 300
         $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children();
301 301
         $pagination->integerNode('limit')
302
-                   ->defaultValue(100)->info('Maximum limit allowed for all paginations');
302
+                    ->defaultValue(100)->info('Maximum limit allowed for all paginations');
303 303
     }
304 304
 
305 305
     protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root)
306 306
     {
307 307
         $namespaces = $root->arrayNode('namespaces')
308
-                           ->info(
309
-                               'Group GraphQL schema using namespaced schemas. 
308
+                            ->info(
309
+                                'Group GraphQL schema using namespaced schemas. 
310 310
 On large schemas is  helpful to keep schemas grouped by bundle and node'
311
-                           )
312
-                           ->canBeEnabled()
313
-                           ->addDefaultsIfNotSet()
314
-                           ->children();
311
+                            )
312
+                            ->canBeEnabled()
313
+                            ->addDefaultsIfNotSet()
314
+                            ->children();
315 315
 
316 316
         $bundles = $namespaces->arrayNode('bundles')
317
-                              ->info('Group each bundle into a separate schema definition')
318
-                              ->canBeDisabled()
319
-                              ->addDefaultsIfNotSet()
320
-                              ->children();
317
+                                ->info('Group each bundle into a separate schema definition')
318
+                                ->canBeDisabled()
319
+                                ->addDefaultsIfNotSet()
320
+                                ->children();
321 321
 
322 322
         $bundles->scalarNode('query_suffix')
323 323
                 ->info('The following suffix will be used for bundle query groups')
@@ -348,25 +348,25 @@  discard block
 block discarded – undo
348 348
                             ->children();
349 349
 
350 350
         $nodes->scalarNode('query_suffix')
351
-              ->info('The following suffix will be used to create the name for queries to the same node')
352
-              ->defaultValue('Query');
351
+                ->info('The following suffix will be used to create the name for queries to the same node')
352
+                ->defaultValue('Query');
353 353
 
354 354
         $nodes->scalarNode('mutation_suffix')
355
-              ->info('The following suffix will be used to create the name for mutations to the same node')
356
-              ->defaultValue('Mutation');
355
+                ->info('The following suffix will be used to create the name for mutations to the same node')
356
+                ->defaultValue('Mutation');
357 357
 
358 358
         $nodes->variableNode('ignore')
359
-              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
360
-              ->defaultValue(['Node']);
359
+                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
360
+                ->defaultValue(['Node']);
361 361
 
362 362
         $nodes->arrayNode('aliases')
363
-              ->info(
364
-                  'Define aliases for nodes to set definitions inside other desired node name. 
363
+                ->info(
364
+                    'Define aliases for nodes to set definitions inside other desired node name. 
365 365
 Can be used to group multiple nodes or publish a node with a different group name'
366
-              )
367
-              ->example('InvoiceItem: Invoice')
368
-              ->useAttributeAsKey('name')
369
-              ->prototype('scalar');
366
+                )
367
+                ->example('InvoiceItem: Invoice')
368
+                ->useAttributeAsKey('name')
369
+                ->prototype('scalar');
370 370
     }
371 371
 
372 372
     private function configureSecurity(NodeBuilder $rootNode)
Please login to merge, or discard this patch.