Passed
Push — master ( 0b86b2...26cfdb )
by Rafael
13:17
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/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/Type/QueryType.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,11 +78,11 @@
 block discarded – undo
78 78
             $eventDispatcher = $this->container->get(EventDispatcherInterface::class);
79 79
 
80 80
             $context = ContextBuilder::create($this->endpoint)
81
-                                     ->setRoot($root)
82
-                                     ->setDefinition($query)
83
-                                     ->setResolveInfo($resolveInfo)
84
-                                     ->setMetas($context->getMetas())
85
-                                     ->build();
81
+                                        ->setRoot($root)
82
+                                        ->setDefinition($query)
83
+                                        ->setResolveInfo($resolveInfo)
84
+                                        ->setMetas($context->getMetas())
85
+                                        ->build();
86 86
 
87 87
             $event = new GraphQLFieldEvent($context);
88 88
             $eventDispatcher->dispatch(GraphQLEvents::PRE_READ_FIELD, $event);
Please login to merge, or discard this patch.
src/DependencyInjection/Configuration.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -50,50 +50,50 @@  discard block
 block discarded – undo
50 50
     protected function configureSubscriptions(NodeBuilder $root)
51 51
     {
52 52
         $subscriptions = $root->arrayNode('subscriptions')
53
-                              ->info('Manage subscriptions settings')
54
-                              ->canBeDisabled()
55
-                              ->addDefaultsIfNotSet()
56
-                              ->children();
53
+                                ->info('Manage subscriptions settings')
54
+                                ->canBeDisabled()
55
+                                ->addDefaultsIfNotSet()
56
+                                ->children();
57 57
 
58 58
         $subscriptions->scalarNode('mercure_hub')->defaultValue('default');
59 59
         $subscriptions->scalarNode('pubsub_handler')->defaultValue(RedisPubSubHandler::class);
60 60
         $redis = $subscriptions->arrayNode('redis')->info('Configure redis server to use as subscription handler')
61
-                               ->addDefaultsIfNotSet()
62
-                               ->children();
61
+                                ->addDefaultsIfNotSet()
62
+                                ->children();
63 63
 
64 64
         $redis->scalarNode('host')->defaultValue('localhost');
65 65
         $redis->integerNode('port')->defaultValue(6379);
66 66
         $redis->scalarNode('prefix')->defaultValue('GraphQLSubscription:')
67
-              ->info('Define custom prefix to avoid collisions between applications');
67
+                ->info('Define custom prefix to avoid collisions between applications');
68 68
     }
69 69
 
70 70
     protected function configureErrorHandling(NodeBuilder $root)
71 71
     {
72 72
         $errorHandling = $root->arrayNode('error_handling')
73
-                              ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
74
-                              ->addDefaultsIfNotSet()
75
-                              ->children();
73
+                                ->info('It is important to handle errors and when possible, report these errors back to your users for information. ')
74
+                                ->addDefaultsIfNotSet()
75
+                                ->children();
76 76
 
77 77
         $errorHandling->enumNode('validation_messages')
78
-                      ->values(['error', 'payload', 'both'])
79
-                      ->info('Where should be displayed validation messages.')
80
-                      ->defaultValue('error');
78
+                        ->values(['error', 'payload', 'both'])
79
+                        ->info('Where should be displayed validation messages.')
80
+                        ->defaultValue('error');
81 81
 
82 82
         //@deprecated since v1.1 snd should be deleted in 2.0, this is a compatibility flag
83 83
         $errorHandling->booleanNode('jwt_auth_failure_compatibility')
84
-                      ->info('Keep BC with oldest version of JWT Authentication errors')
85
-                      ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
86
-                      ->defaultFalse();
84
+                        ->info('Keep BC with oldest version of JWT Authentication errors')
85
+                        ->setDeprecated('Since v1.1 and will will be removed in the next mayor release')
86
+                        ->defaultFalse();
87 87
 
88 88
         $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultFalse();
89 89
 
90 90
         $errorHandling->scalarNode('formatter')
91
-                      ->info('Formatter is responsible for converting instances of Error to an array')
92
-                      ->defaultValue(DefaultErrorFormatter::class);
91
+                        ->info('Formatter is responsible for converting instances of Error to an array')
92
+                        ->defaultValue(DefaultErrorFormatter::class);
93 93
 
94 94
         $errorHandling->scalarNode('handler')
95
-                      ->info('Handler is useful for error filtering and logging.')
96
-                      ->defaultValue(DefaultErrorHandler::class);
95
+                        ->info('Handler is useful for error filtering and logging.')
96
+                        ->defaultValue(DefaultErrorHandler::class);
97 97
 
98 98
         $controlledErrors = $errorHandling
99 99
             ->arrayNode('controlled_errors')
@@ -179,44 +179,44 @@  discard block
 block discarded – undo
179 179
     protected function configureEndpoints(NodeBuilder $root)
180 180
     {
181 181
         $endpoints = $root->arrayNode('endpoints')
182
-                          ->useAttributeAsKey('name')
183
-                          ->validate()
184
-                          ->ifTrue(
185
-                              function ($v) {
186
-                                  return array_key_exists('default', $v);
187
-                              }
188
-                          )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
189
-                          ->end()
190
-                          ->arrayPrototype()
191
-                          ->children();
182
+                            ->useAttributeAsKey('name')
183
+                            ->validate()
184
+                            ->ifTrue(
185
+                                function ($v) {
186
+                                    return array_key_exists('default', $v);
187
+                                }
188
+                            )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.')
189
+                            ->end()
190
+                            ->arrayPrototype()
191
+                            ->children();
192 192
 
193 193
         $endpoints->arrayNode('roles')
194
-                  ->beforeNormalization()
195
-                  ->ifString()
196
-                  ->then(
197
-                      function ($v) {
198
-                          return preg_split('/\s*,\s*/', $v);
199
-                      }
200
-                  )
201
-                  ->end()
202
-                  ->prototype('scalar')
203
-                  ->end();
194
+                    ->beforeNormalization()
195
+                    ->ifString()
196
+                    ->then(
197
+                        function ($v) {
198
+                            return preg_split('/\s*,\s*/', $v);
199
+                        }
200
+                    )
201
+                    ->end()
202
+                    ->prototype('scalar')
203
+                    ->end();
204 204
 
205 205
         $endpoints->scalarNode('host')->example('^api\.backend\.');
206 206
         $endpoints->scalarNode('path')->example('/backend');
207 207
 
208 208
         $root->arrayNode('endpoint_alias')
209
-             ->info('Use alias to refer to multiple endpoints using only one name')
210
-             ->useAttributeAsKey('name')
211
-             ->beforeNormalization()
212
-             ->ifString()
213
-             ->then(
214
-                 function ($v) {
215
-                     return preg_split('/\s*,\s*/', $v);
216
-                 }
217
-             )
218
-             ->end()
219
-             ->variablePrototype();
209
+                ->info('Use alias to refer to multiple endpoints using only one name')
210
+                ->useAttributeAsKey('name')
211
+                ->beforeNormalization()
212
+                ->ifString()
213
+                ->then(
214
+                    function ($v) {
215
+                        return preg_split('/\s*,\s*/', $v);
216
+                    }
217
+                )
218
+                ->end()
219
+                ->variablePrototype();
220 220
 
221 221
         $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.');
222 222
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children();
228 228
 
229 229
         $graphiql->scalarNode('title')
230
-                 ->defaultValue('GraphQL API Explorer');
230
+                    ->defaultValue('GraphQL API Explorer');
231 231
 
232 232
         $graphiql
233 233
             ->scalarNode('data_warning_message')
@@ -255,61 +255,61 @@  discard block
 block discarded – undo
255 255
             ->defaultFalse();
256 256
 
257 257
         $authentication->scalarNode('login_message')
258
-                       ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
258
+                        ->defaultValue('Start exploring GraphQL API queries using your account’s data now.');
259 259
 
260 260
         $authenticationProvider = $authentication->arrayNode('provider')->children();
261 261
 
262 262
         //the updated version of `jwt` to use lexik authentication bundle
263 263
         $lexikJwt = $authenticationProvider->arrayNode('lexik_jwt')
264
-                                           ->canBeEnabled()
265
-                                           ->children();
264
+                                            ->canBeEnabled()
265
+                                            ->children();
266 266
 
267 267
         $lexikJwt->scalarNode('user_provider')
268
-                 ->isRequired()
269
-                 ->info('Name of the user provider to use');
268
+                    ->isRequired()
269
+                    ->info('Name of the user provider to use');
270 270
 
271 271
         $lexikJwt->scalarNode('username_label')
272
-                 ->defaultValue('Username');
272
+                    ->defaultValue('Username');
273 273
 
274 274
         $lexikJwt->scalarNode('password_label')
275
-                 ->defaultValue('Password');
275
+                    ->defaultValue('Password');
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
         //deprecated since v1.1 and should be deleted in v2.0
282 282
         $jwt = $authenticationProvider->arrayNode('jwt')
283
-                                      ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
284
-                                      ->canBeEnabled()
285
-                                      ->children();
283
+                                        ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.')
284
+                                        ->canBeEnabled()
285
+                                        ->children();
286 286
 
287 287
         $jwtLogin = $jwt->arrayNode('login')->children();
288 288
 
289 289
         $jwtLogin->scalarNode('url')
290
-                 ->info('Route name or URI to make the login process to retrieve the token.')
291
-                 ->isRequired();
290
+                    ->info('Route name or URI to make the login process to retrieve the token.')
291
+                    ->isRequired();
292 292
 
293 293
         $jwtLogin->scalarNode('username_parameter')
294
-                 ->defaultValue('username');
294
+                    ->defaultValue('username');
295 295
 
296 296
         $jwtLogin->scalarNode('username_label')
297
-                 ->defaultValue('Username');
297
+                    ->defaultValue('Username');
298 298
 
299 299
         $jwtLogin->scalarNode('password_parameter')
300
-                 ->defaultValue('password');
300
+                    ->defaultValue('password');
301 301
 
302 302
         $jwtLogin->scalarNode('password_label')
303
-                 ->defaultValue('Password');
303
+                    ->defaultValue('Password');
304 304
 
305 305
         $jwtLogin->enumNode('parameters_in')
306
-                 ->values(['form', 'query', 'header'])
307
-                 ->info('How pass parameters to request the token')
308
-                 ->defaultValue('form');
306
+                    ->values(['form', 'query', 'header'])
307
+                    ->info('How pass parameters to request the token')
308
+                    ->defaultValue('form');
309 309
 
310 310
         $jwtLogin->scalarNode('response_token_path')
311
-                 ->defaultValue('token')
312
-                 ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
311
+                    ->defaultValue('token')
312
+                    ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.');
313 313
 
314 314
         $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children();
315 315
 
@@ -348,25 +348,25 @@  discard block
 block discarded – undo
348 348
     {
349 349
         $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children();
350 350
         $pagination->integerNode('limit')
351
-                   ->defaultValue(100)->info('Maximum limit allowed for all paginations');
351
+                    ->defaultValue(100)->info('Maximum limit allowed for all paginations');
352 352
     }
353 353
 
354 354
     protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root)
355 355
     {
356 356
         $namespaces = $root->arrayNode('namespaces')
357
-                           ->info(
358
-                               'Group GraphQL schema using namespaced schemas. 
357
+                            ->info(
358
+                                'Group GraphQL schema using namespaced schemas. 
359 359
 On large schemas is  helpful to keep schemas grouped by bundle and node'
360
-                           )
361
-                           ->canBeEnabled()
362
-                           ->addDefaultsIfNotSet()
363
-                           ->children();
360
+                            )
361
+                            ->canBeEnabled()
362
+                            ->addDefaultsIfNotSet()
363
+                            ->children();
364 364
 
365 365
         $bundles = $namespaces->arrayNode('bundles')
366
-                              ->info('Group each bundle into a separate schema definition')
367
-                              ->canBeDisabled()
368
-                              ->addDefaultsIfNotSet()
369
-                              ->children();
366
+                                ->info('Group each bundle into a separate schema definition')
367
+                                ->canBeDisabled()
368
+                                ->addDefaultsIfNotSet()
369
+                                ->children();
370 370
 
371 371
         $bundles->scalarNode('query_suffix')
372 372
                 ->info('The following suffix will be used for bundle query groups')
@@ -401,29 +401,29 @@  discard block
 block discarded – undo
401 401
                             ->children();
402 402
 
403 403
         $nodes->scalarNode('query_suffix')
404
-              ->info('The following suffix will be used to create the name for queries to the same node')
405
-              ->defaultValue('Query');
404
+                ->info('The following suffix will be used to create the name for queries to the same node')
405
+                ->defaultValue('Query');
406 406
 
407 407
         $nodes->scalarNode('mutation_suffix')
408
-              ->info('The following suffix will be used to create the name for mutations to the same node')
409
-              ->defaultValue('Mutation');
408
+                ->info('The following suffix will be used to create the name for mutations to the same node')
409
+                ->defaultValue('Mutation');
410 410
 
411 411
         $nodes->scalarNode('subscription_suffix')
412
-              ->info('The following suffix will be used to create the name for subscriptions to the same node')
413
-              ->defaultValue('Subscriptions');
412
+                ->info('The following suffix will be used to create the name for subscriptions to the same node')
413
+                ->defaultValue('Subscriptions');
414 414
 
415 415
         $nodes->variableNode('ignore')
416
-              ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
417
-              ->defaultValue(['Node']);
416
+                ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation')
417
+                ->defaultValue(['Node']);
418 418
 
419 419
         $nodes->arrayNode('aliases')
420
-              ->info(
421
-                  'Define aliases for nodes to set definitions inside other desired node name. 
420
+                ->info(
421
+                    'Define aliases for nodes to set definitions inside other desired node name. 
422 422
 Can be used to group multiple nodes or publish a node with a different group name'
423
-              )
424
-              ->example('InvoiceItem: Invoice')
425
-              ->useAttributeAsKey('name')
426
-              ->prototype('scalar');
423
+                )
424
+                ->example('InvoiceItem: Invoice')
425
+                ->useAttributeAsKey('name')
426
+                ->prototype('scalar');
427 427
     }
428 428
 
429 429
     private function configureSecurity(NodeBuilder $rootNode)
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
             ->children();
470 470
 
471 471
         $bcNode->variableNode('filters')
472
-               ->info('Keep deprecated "filters" argument in collections')
473
-               ->setDeprecated('v1.2')
474
-               ->defaultFalse();
472
+                ->info('Keep deprecated "filters" argument in collections')
473
+                ->setDeprecated('v1.2')
474
+                ->defaultFalse();
475 475
 
476 476
         $bcNode->variableNode('orderBy')
477
-               ->info('Keep deprecated "orderBy" argument in collections')
478
-               ->setDeprecated('v1.2')
479
-               ->defaultFalse();
477
+                ->info('Keep deprecated "orderBy" argument in collections')
478
+                ->setDeprecated('v1.2')
479
+                ->defaultFalse();
480 480
     }
481 481
 }
Please login to merge, or discard this patch.