Completed
Push — master ( 0a9298...bcf5cf )
by Rafael
06:09
created
src/Definition/Plugin/PaginationDefinitionPlugin.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -77,19 +77,19 @@
 block discarded – undo
77 77
 
78 78
         /** @var NodeBuilder $rootNode */
79 79
         $config->scalarNode('target')
80
-               ->info('Target node to properly paginate. If is possible will be auto-resolved using naming conventions')
81
-               ->isRequired();
80
+                ->info('Target node to properly paginate. If is possible will be auto-resolved using naming conventions')
81
+                ->isRequired();
82 82
         $config->variableNode('filters')
83
-               ->info('Filters configuration');
83
+                ->info('Filters configuration');
84 84
         $config->variableNode('order_by');
85 85
         $config->variableNode('search_fields');
86 86
         $config->integerNode('limit')->info('Max number of records allowed for first & last')->defaultValue($this->limit);
87 87
         $config->scalarNode('parent_field')
88
-               ->info('When is used in sub-fields should be the field to filter by parent instance');
88
+                ->info('When is used in sub-fields should be the field to filter by parent instance');
89 89
         $config->enumNode('parent_relation')
90
-               ->info('When is used in sub-fields should be the type of relation with the parent field')
91
-               ->defaultValue(self::ONE_TO_MANY)
92
-               ->values([self::ONE_TO_MANY, self::MANY_TO_MANY]);
90
+                ->info('When is used in sub-fields should be the type of relation with the parent field')
91
+                ->defaultValue(self::ONE_TO_MANY)
92
+                ->values([self::ONE_TO_MANY, self::MANY_TO_MANY]);
93 93
     }
94 94
 
95 95
     /**
Please login to merge, or discard this patch.
src/Definition/Plugin/MutationFormResolverPlugin.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,12 +84,12 @@
 block discarded – undo
84 84
             );
85 85
         $config->variableNode('options')->defaultValue([])->info('Form options');
86 86
         $config->variableNode('argument')
87
-               ->defaultValue('input')
88
-               ->info('Name of the argument to use as input');
87
+                ->defaultValue('input')
88
+                ->info('Name of the argument to use as input');
89 89
 
90 90
         $config->booleanNode('client_mutation_id')
91
-               ->defaultTrue()
92
-               ->info('Automatically add a field called clientMutationId');
91
+                ->defaultTrue()
92
+                ->info('Automatically add a field called clientMutationId');
93 93
     }
94 94
 
95 95
     /**
Please login to merge, or discard this patch.
src/Subscription/SubscriptionLink.php 1 patch
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
 Can susbribe to a service using something like:
20 20
 
21 21
     new EventSource(subscription.url)
22
-
23
-**NOTE:** A subscription have a tll (Time to live), you must call a periodic request (heartbeat) to
22
+ **NOTE:** A subscription have a tll (Time to live), you must call a periodic request (heartbeat) to
24 23
 the `heartbeatUrl` in order to keep-alive the subscription. Otherwise the subscription will be not available
25 24
 after the specified ttl.
26 25
 ")
Please login to merge, or discard this patch.
src/Type/Definition/InputObjectDefinitionType.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@
 block discarded – undo
52 52
                 'resolveField' => function ($root, array $args, ResolverContext $context, ResolveInfo $resolveInfo) use ($definition) {
53 53
                     $resolver = new ObjectFieldResolver($this->container);
54 54
                     $context = ContextBuilder::create($context->getEndpoint())
55
-                                             ->setRoot($root)
56
-                                             ->setResolveInfo($resolveInfo)
57
-                                             ->setArgs($args)
58
-                                             ->setMetas($context->getMetas())
59
-                                             ->setDefinition($definition->getField($resolveInfo->fieldName))
60
-                                             ->build();
55
+                                                ->setRoot($root)
56
+                                                ->setResolveInfo($resolveInfo)
57
+                                                ->setArgs($args)
58
+                                                ->setMetas($context->getMetas())
59
+                                                ->setDefinition($definition->getField($resolveInfo->fieldName))
60
+                                                ->build();
61 61
 
62 62
 
63 63
                     return $resolver($root, $args, $context, $resolveInfo);
Please login to merge, or discard this patch.
src/Command/SubscriptionConsumerCommand.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     protected function configure()
58 58
     {
59 59
         $this->setName('graphql:subscriptions:consume')
60
-             ->setDescription('Listen for subscriptions to consume then and dispatch to mercure HUB.');
60
+                ->setDescription('Listen for subscriptions to consume then and dispatch to mercure HUB.');
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
src/Resolver/ResolverExecutor.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,12 +136,12 @@
 block discarded – undo
136 136
 
137 137
         if ($resolver && $refMethod) {
138 138
             $this->context = ContextBuilder::create($context->getEndpoint())
139
-                                           ->setRoot($root)
140
-                                           ->setResolveInfo($resolveInfo)
141
-                                           ->setArgs($args)
142
-                                           ->setMetas($context->getMetas())
143
-                                           ->setDefinition($this->executableDefinition)
144
-                                           ->build();
139
+                                            ->setRoot($root)
140
+                                            ->setResolveInfo($resolveInfo)
141
+                                            ->setArgs($args)
142
+                                            ->setMetas($context->getMetas())
143
+                                            ->setDefinition($this->executableDefinition)
144
+                                            ->build();
145 145
 
146 146
             if ($resolver instanceof ResolverInterface) {
147 147
                 $resolver->setContext($this->context);
Please login to merge, or discard this patch.
src/Resolver/ObjectFieldResolver.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,12 +88,12 @@
 block discarded – undo
88 88
             }
89 89
 
90 90
             $context = ContextBuilder::create($context->getEndpoint())
91
-                                     ->setArgs($args)
92
-                                     ->setRoot($root)
93
-                                     ->setDefinition($queryDefinition)
94
-                                     ->setResolveInfo($info)
95
-                                     ->setMetas($context->getMetas())
96
-                                     ->build();
91
+                                        ->setArgs($args)
92
+                                        ->setRoot($root)
93
+                                        ->setDefinition($queryDefinition)
94
+                                        ->setResolveInfo($info)
95
+                                        ->setMetas($context->getMetas())
96
+                                        ->build();
97 97
 
98 98
             $resolver = new ResolverExecutor($this->container, $queryDefinition);
99 99
             $value = $resolver($root, $args, $context, $info);
Please login to merge, or discard this patch.
src/Type/Definition/ObjectDefinitionType.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@
 block discarded – undo
52 52
                 'resolveField' => function ($root, array $args, ResolverContext $context, ResolveInfo $resolveInfo) use ($definition) {
53 53
                     $resolver = new ObjectFieldResolver($this->container);
54 54
                     $context = ContextBuilder::create($context->getEndpoint())
55
-                                             ->setRoot($root)
56
-                                             ->setResolveInfo($resolveInfo)
57
-                                             ->setArgs($args)
58
-                                             ->setMetas($context->getMetas())
59
-                                             ->setDefinition($definition->getField($resolveInfo->fieldName))
60
-                                             ->build();
55
+                                                ->setRoot($root)
56
+                                                ->setResolveInfo($resolveInfo)
57
+                                                ->setArgs($args)
58
+                                                ->setMetas($context->getMetas())
59
+                                                ->setDefinition($definition->getField($resolveInfo->fieldName))
60
+                                                ->build();
61 61
 
62 62
 
63 63
                     return $resolver($root, $args, $context, $resolveInfo);
Please login to merge, or discard this patch.
src/DependencyInjection/Configuration.php 1 patch
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -51,52 +51,52 @@  discard block
 block discarded – undo
51 51
     protected function configureSubscriptions(NodeBuilder $root)
52 52
     {
53 53
         $subscriptions = $root->arrayNode('subscriptions')
54
-                              ->info('Manage subscriptions settings')
55
-                              ->canBeDisabled()
56
-                              ->addDefaultsIfNotSet()
57
-                              ->children();
54
+                                ->info('Manage subscriptions settings')
55
+                                ->canBeDisabled()
56
+                                ->addDefaultsIfNotSet()
57
+                                ->children();
58 58
 
59 59
         $subscriptions->scalarNode('ttl')->defaultValue(Subscriber::DEFAULT_SUBSCRIPTION_TTL)
60
-                      ->info('Time to live for subscriptions. The subscription will be deleted after this time, a heartbeat is required to keep-alive');
60
+                        ->info('Time to live for subscriptions. The subscription will be deleted after this time, a heartbeat is required to keep-alive');
61 61
         $subscriptions->scalarNode('mercure_hub')->defaultValue('default');
62 62
         $subscriptions->scalarNode('pubsub_handler')->defaultValue(RedisPubSubHandler::class);
63 63
         $redis = $subscriptions->arrayNode('redis')->info('Configure redis server to use as subscription handler')
64
-                               ->addDefaultsIfNotSet()
65
-                               ->children();
64
+                                ->addDefaultsIfNotSet()
65
+                                ->children();
66 66
 
67 67
         $redis->scalarNode('host')->defaultValue('localhost');
68 68
         $redis->integerNode('port')->defaultValue(6379);
69 69
         $redis->scalarNode('prefix')->defaultValue('GraphQLSubscription:')
70
-              ->info('Define custom prefix to avoid collisions between applications');
70
+                ->info('Define custom prefix to avoid collisions between applications');
71 71
     }
72 72
 
73 73
     protected function configureErrorHandling(NodeBuilder $root)
74 74
     {
75 75
         $errorHandling = $root->arrayNode('error_handling')
76
-                              ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
77
-                              ->addDefaultsIfNotSet()
78
-                              ->children();
76
+                                ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
77
+                                ->addDefaultsIfNotSet()
78
+                                ->children();
79 79
 
80 80
         $errorHandling->enumNode('validation_messages')
81
-                      ->values(['error', 'payload', 'both'])
82
-                      ->info('Where should be displayed validation messages.')
83
-                      ->defaultValue('error');
81
+                        ->values(['error', 'payload', 'both'])
82
+                        ->info('Where should be displayed validation messages.')
83
+                        ->defaultValue('error');
84 84
 
85 85
         //@deprecated since v1.1 snd should be deleted in 2.0, this is a compatibility flag
86 86
         $errorHandling->booleanNode('jwt_auth_failure_compatibility')
87
-                      ->info('Keep BC with oldest version of JWT Authentication errors')
88
-                      ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
89
-                      ->defaultFalse();
87
+                        ->info('Keep BC with oldest version of JWT Authentication errors')
88
+                        ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
89
+                        ->defaultFalse();
90 90
 
91 91
         $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultFalse();
92 92
 
93 93
         $errorHandling->scalarNode('formatter')
94
-                      ->info('Formatter is responsible for converting instances of Error to an array')
95
-                      ->defaultValue(DefaultErrorFormatter::class);
94
+                        ->info('Formatter is responsible for converting instances of Error to an array')
95
+                        ->defaultValue(DefaultErrorFormatter::class);
96 96
 
97 97
         $errorHandling->scalarNode('handler')
98
-                      ->info('Handler is useful for error filtering and logging.')
99
-                      ->defaultValue(DefaultErrorHandler::class);
98
+                        ->info('Handler is useful for error filtering and logging.')
99
+                        ->defaultValue(DefaultErrorHandler::class);
100 100
 
101 101
         $controlledErrors = $errorHandling
102 102
             ->arrayNode('controlled_errors')
@@ -182,44 +182,44 @@  discard block
 block discarded – undo
182 182
     protected function configureEndpoints(NodeBuilder $root)
183 183
     {
184 184
         $endpoints = $root->arrayNode('endpoints')
185
-                          ->useAttributeAsKey('name')
186
-                          ->validate()
187
-                          ->ifTrue(
188
-                              function ($v) {
189
-                                  return array_key_exists('default', $v);
190
-                              }
191
-                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
192
-                          ->end()
193
-                          ->arrayPrototype()
194
-                          ->children();
185
+                            ->useAttributeAsKey('name')
186
+                            ->validate()
187
+                            ->ifTrue(
188
+                                function ($v) {
189
+                                    return array_key_exists('default', $v);
190
+                                }
191
+                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
192
+                            ->end()
193
+                            ->arrayPrototype()
194
+                            ->children();
195 195
 
196 196
         $endpoints->arrayNode('roles')
197
-                  ->beforeNormalization()
198
-                  ->ifString()
199
-                  ->then(
200
-                      function ($v) {
201
-                          return preg_split('/\s*,\s*/', $v);
202
-                      }
203
-                  )
204
-                  ->end()
205
-                  ->prototype('scalar')
206
-                  ->end();
197
+                    ->beforeNormalization()
198
+                    ->ifString()
199
+                    ->then(
200
+                        function ($v) {
201
+                            return preg_split('/\s*,\s*/', $v);
202
+                        }
203
+                    )
204
+                    ->end()
205
+                    ->prototype('scalar')
206
+                    ->end();
207 207
 
208 208
         $endpoints->scalarNode('host')->example('^api\.backend\.');
209 209
         $endpoints->scalarNode('path')->example('/backend');
210 210
 
211 211
         $root->arrayNode('endpoint_alias')
212
-             ->info('Use alias to refer to multiple endpoints using only one name')
213
-             ->useAttributeAsKey('name')
214
-             ->beforeNormalization()
215
-             ->ifString()
216
-             ->then(
217
-                 function ($v) {
218
-                     return preg_split('/\s*,\s*/', $v);
219
-                 }
220
-             )
221
-             ->end()
222
-             ->variablePrototype();
212
+                ->info('Use alias to refer to multiple endpoints using only one name')
213
+                ->useAttributeAsKey('name')
214
+                ->beforeNormalization()
215
+                ->ifString()
216
+                ->then(
217
+                    function ($v) {
218
+                        return preg_split('/\s*,\s*/', $v);
219
+                    }
220
+                )
221
+                ->end()
222
+                ->variablePrototype();
223 223
 
224 224
         $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.');
225 225
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children();
231 231
 
232 232
         $graphiql->scalarNode('title')
233
-                 ->defaultValue('GraphQL API Explorer');
233
+                    ->defaultValue('GraphQL API Explorer');
234 234
 
235 235
         $graphiql
236 236
             ->scalarNode('data_warning_message')
@@ -258,61 +258,61 @@  discard block
 block discarded – undo
258 258
             ->defaultFalse();
259 259
 
260 260
         $authentication->scalarNode('login_message')
261
-                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
261
+                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
262 262
 
263 263
         $authenticationProvider = $authentication->arrayNode('provider')->children();
264 264
 
265 265
         //the updated version of `jwt` to use lexik authentication bundle
266 266
         $lexikJwt = $authenticationProvider->arrayNode('lexik_jwt')
267
-                                           ->canBeEnabled()
268
-                                           ->children();
267
+                                            ->canBeEnabled()
268
+                                            ->children();
269 269
 
270 270
         $lexikJwt->scalarNode('user_provider')
271
-                 ->isRequired()
272
-                 ->info('Name of the user provider to use');
271
+                    ->isRequired()
272
+                    ->info('Name of the user provider to use');
273 273
 
274 274
         $lexikJwt->scalarNode('username_label')
275
-                 ->defaultValue('Username');
275
+                    ->defaultValue('Username');
276 276
 
277 277
         $lexikJwt->scalarNode('password_label')
278
-                 ->defaultValue('Password');
278
+                    ->defaultValue('Password');
279 279
 
280 280
         $authenticationProvider->scalarNode('custom')
281
-                               ->defaultNull()
282
-                               ->info('Configure custom service to use as authentication provider');
281
+                                ->defaultNull()
282
+                                ->info('Configure custom service to use as authentication provider');
283 283
 
284 284
         //deprecated since v1.1 and should be deleted in v2.0
285 285
         $jwt = $authenticationProvider->arrayNode('jwt')
286
-                                      ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
287
-                                      ->canBeEnabled()
288
-                                      ->children();
286
+                                        ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
287
+                                        ->canBeEnabled()
288
+                                        ->children();
289 289
 
290 290
         $jwtLogin = $jwt->arrayNode('login')->children();
291 291
 
292 292
         $jwtLogin->scalarNode('url')
293
-                 ->info('Route name or URI to make the login process to retrieve the token.')
294
-                 ->isRequired();
293
+                    ->info('Route name or URI to make the login process to retrieve the token.')
294
+                    ->isRequired();
295 295
 
296 296
         $jwtLogin->scalarNode('username_parameter')
297
-                 ->defaultValue('username');
297
+                    ->defaultValue('username');
298 298
 
299 299
         $jwtLogin->scalarNode('username_label')
300
-                 ->defaultValue('Username');
300
+                    ->defaultValue('Username');
301 301
 
302 302
         $jwtLogin->scalarNode('password_parameter')
303
-                 ->defaultValue('password');
303
+                    ->defaultValue('password');
304 304
 
305 305
         $jwtLogin->scalarNode('password_label')
306
-                 ->defaultValue('Password');
306
+                    ->defaultValue('Password');
307 307
 
308 308
         $jwtLogin->enumNode('parameters_in')
309
-                 ->values(['form', 'query', 'header'])
310
-                 ->info('How pass parameters to request the token')
311
-                 ->defaultValue('form');
309
+                    ->values(['form', 'query', 'header'])
310
+                    ->info('How pass parameters to request the token')
311
+                    ->defaultValue('form');
312 312
 
313 313
         $jwtLogin->scalarNode('response_token_path')
314
-                 ->defaultValue('token')
315
-                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
314
+                    ->defaultValue('token')
315
+                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
316 316
 
317 317
         $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children();
318 318
 
@@ -351,25 +351,25 @@  discard block
 block discarded – undo
351 351
     {
352 352
         $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children();
353 353
         $pagination->integerNode('limit')
354
-                   ->defaultValue(100)->info('Maximum limit allowed for all paginations');
354
+                    ->defaultValue(100)->info('Maximum limit allowed for all paginations');
355 355
     }
356 356
 
357 357
     protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root)
358 358
     {
359 359
         $namespaces = $root->arrayNode('namespaces')
360
-                           ->info(
361
-                               'Group GraphQL schema using namespaced schemas. 
360
+                            ->info(
361
+                                'Group GraphQL schema using namespaced schemas. 
362 362
 On large schemas is  helpful to keep schemas grouped by bundle and node'
363
-                           )
364
-                           ->canBeEnabled()
365
-                           ->addDefaultsIfNotSet()
366
-                           ->children();
363
+                            )
364
+                            ->canBeEnabled()
365
+                            ->addDefaultsIfNotSet()
366
+                            ->children();
367 367
 
368 368
         $bundles = $namespaces->arrayNode('bundles')
369
-                              ->info('Group each bundle into a separate schema definition')
370
-                              ->canBeDisabled()
371
-                              ->addDefaultsIfNotSet()
372
-                              ->children();
369
+                                ->info('Group each bundle into a separate schema definition')
370
+                                ->canBeDisabled()
371
+                                ->addDefaultsIfNotSet()
372
+                                ->children();
373 373
 
374 374
         $bundles->scalarNode('query_suffix')
375 375
                 ->info('The following suffix will be used for bundle query groups')
@@ -404,29 +404,29 @@  discard block
 block discarded – undo
404 404
                             ->children();
405 405
 
406 406
         $nodes->scalarNode('query_suffix')
407
-              ->info('The following suffix will be used to create the name for queries to the same node')
408
-              ->defaultValue('Query');
407
+                ->info('The following suffix will be used to create the name for queries to the same node')
408
+                ->defaultValue('Query');
409 409
 
410 410
         $nodes->scalarNode('mutation_suffix')
411
-              ->info('The following suffix will be used to create the name for mutations to the same node')
412
-              ->defaultValue('Mutation');
411
+                ->info('The following suffix will be used to create the name for mutations to the same node')
412
+                ->defaultValue('Mutation');
413 413
 
414 414
         $nodes->scalarNode('subscription_suffix')
415
-              ->info('The following suffix will be used to create the name for subscriptions to the same node')
416
-              ->defaultValue('Subscriptions');
415
+                ->info('The following suffix will be used to create the name for subscriptions to the same node')
416
+                ->defaultValue('Subscriptions');
417 417
 
418 418
         $nodes->variableNode('ignore')
419
-              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
420
-              ->defaultValue(['Node']);
419
+                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
420
+                ->defaultValue(['Node']);
421 421
 
422 422
         $nodes->arrayNode('aliases')
423
-              ->info(
424
-                  'Define aliases for nodes to set definitions inside other desired node name. 
423
+                ->info(
424
+                    'Define aliases for nodes to set definitions inside other desired node name. 
425 425
 Can be used to group multiple nodes or publish a node with a different group name'
426
-              )
427
-              ->example('InvoiceItem: Invoice')
428
-              ->useAttributeAsKey('name')
429
-              ->prototype('scalar');
426
+                )
427
+                ->example('InvoiceItem: Invoice')
428
+                ->useAttributeAsKey('name')
429
+                ->prototype('scalar');
430 430
     }
431 431
 
432 432
     private function configureSecurity(NodeBuilder $rootNode)
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
             ->children();
473 473
 
474 474
         $bcNode->variableNode('filters')
475
-               ->info('Keep deprecated "filters" argument in collections')
476
-               ->setDeprecated('v1.2')
477
-               ->defaultFalse();
475
+                ->info('Keep deprecated "filters" argument in collections')
476
+                ->setDeprecated('v1.2')
477
+                ->defaultFalse();
478 478
 
479 479
         $bcNode->variableNode('orderBy')
480
-               ->info('Keep deprecated "orderBy" argument in collections')
481
-               ->setDeprecated('v1.2')
482
-               ->defaultFalse();
480
+                ->info('Keep deprecated "orderBy" argument in collections')
481
+                ->setDeprecated('v1.2')
482
+                ->defaultFalse();
483 483
     }
484 484
 }
Please login to merge, or discard this patch.