Completed
Push — master ( f77b2b...6fd5f2 )
by Rafael
05:32
created
src/Controller/GraphQLEndpointController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
 
184 184
             $result->setErrorFormatter([$formatter, 'format']);
185 185
             $result->setErrorsHandler(
186
-                function ($errors) use ($handler, $formatter) {
186
+                function($errors) use ($handler, $formatter) {
187 187
                     return $handler->handle($errors, $formatter, $this->getDebugMode());
188 188
                 }
189 189
             );
Please login to merge, or discard this patch.
src/DependencyInjection/Configuration.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -47,30 +47,30 @@  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
         //@deprecated since v1.1 snd should be deleted in 2.0, this is a compatibility flag
60 60
         $errorHandling->booleanNode('jwt_auth_failure_compatibility')
61
-                      ->info('Keep BC with oldest version of JWT Authentication errors')
62
-                      ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
63
-                      ->defaultFalse();
61
+                        ->info('Keep BC with oldest version of JWT Authentication errors')
62
+                        ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
63
+                        ->defaultFalse();
64 64
 
65 65
         $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultFalse();
66 66
 
67 67
         $errorHandling->scalarNode('formatter')
68
-                      ->info('Formatter is responsible for converting instances of Error to an array')
69
-                      ->defaultValue(DefaultErrorFormatter::class);
68
+                        ->info('Formatter is responsible for converting instances of Error to an array')
69
+                        ->defaultValue(DefaultErrorFormatter::class);
70 70
 
71 71
         $errorHandling->scalarNode('handler')
72
-                      ->info('Handler is useful for error filtering and logging.')
73
-                      ->defaultValue(DefaultErrorHandler::class);
72
+                        ->info('Handler is useful for error filtering and logging.')
73
+                        ->defaultValue(DefaultErrorHandler::class);
74 74
 
75 75
         $controlledErrors = $errorHandling
76 76
             ->arrayNode('controlled_errors')
@@ -156,44 +156,44 @@  discard block
 block discarded – undo
156 156
     protected function configureEndpoints(NodeBuilder $root)
157 157
     {
158 158
         $endpoints = $root->arrayNode('endpoints')
159
-                          ->useAttributeAsKey('name')
160
-                          ->validate()
161
-                          ->ifTrue(
162
-                              function ($v) {
163
-                                  return array_key_exists('default', $v);
164
-                              }
165
-                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
166
-                          ->end()
167
-                          ->arrayPrototype()
168
-                          ->children();
159
+                            ->useAttributeAsKey('name')
160
+                            ->validate()
161
+                            ->ifTrue(
162
+                                function ($v) {
163
+                                    return array_key_exists('default', $v);
164
+                                }
165
+                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
166
+                            ->end()
167
+                            ->arrayPrototype()
168
+                            ->children();
169 169
 
170 170
         $endpoints->arrayNode('roles')
171
-                  ->beforeNormalization()
172
-                  ->ifString()
173
-                  ->then(
174
-                      function ($v) {
175
-                          return preg_split('/\s*,\s*/', $v);
176
-                      }
177
-                  )
178
-                  ->end()
179
-                  ->prototype('scalar')
180
-                  ->end();
171
+                    ->beforeNormalization()
172
+                    ->ifString()
173
+                    ->then(
174
+                        function ($v) {
175
+                            return preg_split('/\s*,\s*/', $v);
176
+                        }
177
+                    )
178
+                    ->end()
179
+                    ->prototype('scalar')
180
+                    ->end();
181 181
 
182 182
         $endpoints->scalarNode('host')->example('^api\.backend\.');
183 183
         $endpoints->scalarNode('path')->example('/backend');
184 184
 
185 185
         $root->arrayNode('endpoint_alias')
186
-             ->info('Use alias to refer to multiple endpoints using only one name')
187
-             ->useAttributeAsKey('name')
188
-             ->beforeNormalization()
189
-             ->ifString()
190
-             ->then(
191
-                 function ($v) {
192
-                     return preg_split('/\s*,\s*/', $v);
193
-                 }
194
-             )
195
-             ->end()
196
-             ->variablePrototype();
186
+                ->info('Use alias to refer to multiple endpoints using only one name')
187
+                ->useAttributeAsKey('name')
188
+                ->beforeNormalization()
189
+                ->ifString()
190
+                ->then(
191
+                    function ($v) {
192
+                        return preg_split('/\s*,\s*/', $v);
193
+                    }
194
+                )
195
+                ->end()
196
+                ->variablePrototype();
197 197
 
198 198
         $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.');
199 199
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children();
205 205
 
206 206
         $graphiql->scalarNode('title')
207
-                 ->defaultValue('GraphQL API Explorer');
207
+                    ->defaultValue('GraphQL API Explorer');
208 208
 
209 209
         $graphiql
210 210
             ->scalarNode('data_warning_message')
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             ->defaultFalse();
233 233
 
234 234
         $authentication->scalarNode('login_message')
235
-                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
235
+                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
236 236
 
237 237
         $authenticationProvider = $authentication->arrayNode('provider')->children();
238 238
 
@@ -241,29 +241,29 @@  discard block
 block discarded – undo
241 241
         $jwtLogin = $jwt->arrayNode('login')->children();
242 242
 
243 243
         $jwtLogin->scalarNode('url')
244
-                 ->info('Route name or URI to make the login process to retrieve the token.')
245
-                 ->isRequired();
244
+                    ->info('Route name or URI to make the login process to retrieve the token.')
245
+                    ->isRequired();
246 246
 
247 247
         $jwtLogin->scalarNode('username_parameter')
248
-                 ->defaultValue('username');
248
+                    ->defaultValue('username');
249 249
 
250 250
         $jwtLogin->scalarNode('username_label')
251
-                 ->defaultValue('Username');
251
+                    ->defaultValue('Username');
252 252
 
253 253
         $jwtLogin->scalarNode('password_parameter')
254
-                 ->defaultValue('password');
254
+                    ->defaultValue('password');
255 255
 
256 256
         $jwtLogin->scalarNode('password_label')
257
-                 ->defaultValue('Password');
257
+                    ->defaultValue('Password');
258 258
 
259 259
         $jwtLogin->enumNode('parameters_in')
260
-                 ->values(['form', 'query', 'header'])
261
-                 ->info('How pass parameters to request the token')
262
-                 ->defaultValue('form');
260
+                    ->values(['form', 'query', 'header'])
261
+                    ->info('How pass parameters to request the token')
262
+                    ->defaultValue('form');
263 263
 
264 264
         $jwtLogin->scalarNode('response_token_path')
265
-                 ->defaultValue('token')
266
-                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
265
+                    ->defaultValue('token')
266
+                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
267 267
 
268 268
         $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children();
269 269
 
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
                     ->info('Customize how the token should be send,  use the place holder {token} to replace for current token');
282 282
 
283 283
         $authenticationProvider->scalarNode('custom')
284
-                               ->defaultNull()
285
-                               ->info('Configure custom service to use as authentication provider');
284
+                                ->defaultNull()
285
+                                ->info('Configure custom service to use as authentication provider');
286 286
     }
287 287
 
288 288
     protected function configureCORS(NodeBuilder $root)
@@ -305,25 +305,25 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children();
307 307
         $pagination->integerNode('limit')
308
-                   ->defaultValue(100)->info('Maximum limit allowed for all paginations');
308
+                    ->defaultValue(100)->info('Maximum limit allowed for all paginations');
309 309
     }
310 310
 
311 311
     protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root)
312 312
     {
313 313
         $namespaces = $root->arrayNode('namespaces')
314
-                           ->info(
315
-                               'Group GraphQL schema using namespaced schemas. 
314
+                            ->info(
315
+                                'Group GraphQL schema using namespaced schemas. 
316 316
 On large schemas is  helpful to keep schemas grouped by bundle and node'
317
-                           )
318
-                           ->canBeEnabled()
319
-                           ->addDefaultsIfNotSet()
320
-                           ->children();
317
+                            )
318
+                            ->canBeEnabled()
319
+                            ->addDefaultsIfNotSet()
320
+                            ->children();
321 321
 
322 322
         $bundles = $namespaces->arrayNode('bundles')
323
-                              ->info('Group each bundle into a separate schema definition')
324
-                              ->canBeDisabled()
325
-                              ->addDefaultsIfNotSet()
326
-                              ->children();
323
+                                ->info('Group each bundle into a separate schema definition')
324
+                                ->canBeDisabled()
325
+                                ->addDefaultsIfNotSet()
326
+                                ->children();
327 327
 
328 328
         $bundles->scalarNode('query_suffix')
329 329
                 ->info('The following suffix will be used for bundle query groups')
@@ -354,25 +354,25 @@  discard block
 block discarded – undo
354 354
                             ->children();
355 355
 
356 356
         $nodes->scalarNode('query_suffix')
357
-              ->info('The following suffix will be used to create the name for queries to the same node')
358
-              ->defaultValue('Query');
357
+                ->info('The following suffix will be used to create the name for queries to the same node')
358
+                ->defaultValue('Query');
359 359
 
360 360
         $nodes->scalarNode('mutation_suffix')
361
-              ->info('The following suffix will be used to create the name for mutations to the same node')
362
-              ->defaultValue('Mutation');
361
+                ->info('The following suffix will be used to create the name for mutations to the same node')
362
+                ->defaultValue('Mutation');
363 363
 
364 364
         $nodes->variableNode('ignore')
365
-              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
366
-              ->defaultValue(['Node']);
365
+                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
366
+                ->defaultValue(['Node']);
367 367
 
368 368
         $nodes->arrayNode('aliases')
369
-              ->info(
370
-                  'Define aliases for nodes to set definitions inside other desired node name. 
369
+                ->info(
370
+                    'Define aliases for nodes to set definitions inside other desired node name. 
371 371
 Can be used to group multiple nodes or publish a node with a different group name'
372
-              )
373
-              ->example('InvoiceItem: Invoice')
374
-              ->useAttributeAsKey('name')
375
-              ->prototype('scalar');
372
+                )
373
+                ->example('InvoiceItem: Invoice')
374
+                ->useAttributeAsKey('name')
375
+                ->prototype('scalar');
376 376
     }
377 377
 
378 378
     private function configureSecurity(NodeBuilder $rootNode)
Please login to merge, or discard this patch.