Passed
Push — master ( c66900...e3cbf5 )
by Rafael
06:44
created
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.
src/DependencyInjection/YnloGraphQLExtension.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         if ($config['graphiql']['authentication']['provider']['lexik_jwt']['enabled'] ?? false) {
107 107
             $providerName = sprintf('security.user.provider.concrete.%s', $config['graphiql']['authentication']['provider']['lexik_jwt']['user_provider']);
108 108
             $container->getDefinition(LexikJWTGraphiQLAuthenticator::class)
109
-                      ->setArgument(1, new Reference($providerName));
109
+                        ->setArgument(1, new Reference($providerName));
110 110
         } else {
111 111
             $container->removeDefinition(LexikJWTGraphiQLAuthenticator::class);
112 112
         }
@@ -115,14 +115,14 @@  discard block
 block discarded – undo
115 115
 
116 116
         //build the ID encoder manager with configured encoder
117 117
         $container->getDefinition(IDEncoderManager::class)
118
-                  ->setPublic(true)
119
-                  ->replaceArgument(0, new Reference($config['id_encoder']));
118
+                    ->setPublic(true)
119
+                    ->replaceArgument(0, new Reference($config['id_encoder']));
120 120
 
121 121
 
122 122
         //endpoint definition
123 123
         $container->getDefinition(GraphQLEndpointController::class)
124
-                  ->addMethodCall('setErrorFormatter', [new Reference($config['error_handling']['formatter'])])
125
-                  ->addMethodCall('setErrorHandler', [new Reference($config['error_handling']['handler'])]);
124
+                    ->addMethodCall('setErrorFormatter', [new Reference($config['error_handling']['formatter'])])
125
+                    ->addMethodCall('setErrorHandler', [new Reference($config['error_handling']['handler'])]);
126 126
 
127 127
         $bundles = $container->getParameter('kernel.bundles');
128 128
         if (isset($bundles['MercureBundle']) && $config['subscriptions']['enabled']) {
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
             $mercurePublisherReference = new Reference(sprintf('mercure.hub.%s.publisher', $mercureHub));
132 132
 
133 133
             $container->getDefinition(SubscriptionManager::class)
134
-                      ->addArgument(new Reference($config['subscriptions']['pubsub_handler']))
135
-                      ->addArgument(new Parameter('kernel.secret'));
134
+                        ->addArgument(new Reference($config['subscriptions']['pubsub_handler']))
135
+                        ->addArgument(new Parameter('kernel.secret'));
136 136
 
137 137
             $container->getDefinition(Subscriber::class)
138
-                      ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]);
138
+                        ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]);
139 139
 
140 140
             $container->getDefinition(SubscriptionConsumerCommand::class)
141
-                      ->addArgument($mercurePublisherReference);
141
+                        ->addArgument($mercurePublisherReference);
142 142
 
143 143
             $container->getDefinition(GraphQLEndpointController::class)->addMethodCall('setPublisher', [$mercurePublisherReference]);
144 144
         } else {
Please login to merge, or discard this patch.
src/Command/MercureHubCommand.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@
 block discarded – undo
51 51
     protected function configure()
52 52
     {
53 53
         $this->setName('graphql:mercure:start')
54
-             ->setDescription('Start mercure HUB server. Define mercure settings using env variables with MERCURE_* prefix in your .env file')
55
-             ->addArgument('mercure', InputArgument::REQUIRED, 'Mercure binary');
54
+                ->setDescription('Start mercure HUB server. Define mercure settings using env variables with MERCURE_* prefix in your .env file')
55
+                ->addArgument('mercure', InputArgument::REQUIRED, 'Mercure binary');
56 56
     }
57 57
 
58 58
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $subscribersByTopics = [];
80 80
 
81 81
         $process->run(
82
-            static function ($type, $msg) use ($output, &$subscribersByTopics, $subscriptionManager) {
82
+            static function($type, $msg) use ($output, &$subscribersByTopics, $subscriptionManager) {
83 83
                 $output->writeln($msg);
84 84
 
85 85
                 $connected = strpos($msg, '"New subscriber"') !== false;
Please login to merge, or discard this patch.