@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | array_walk_recursive( |
| 93 | 93 | $data, |
| 94 | - function (&$value, $key) { |
|
| 94 | + function(&$value, $key) { |
|
| 95 | 95 | if (is_object($value)) { |
| 96 | 96 | throw new \RuntimeException( |
| 97 | 97 | sprintf('The object "%s" in key "%s" can\'t be part of publish data, only scalar values can be sent.', get_class($value), $key) |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $channels = array_keys($this->registry->getEndpoint()->getSubscriptionsResolvers()); |
| 113 | 113 | $this->pubSubHandler->consume( |
| 114 | 114 | $channels, |
| 115 | - function (SubscriptionMessage $message) use ($output, $debug) { |
|
| 115 | + function(SubscriptionMessage $message) use ($output, $debug) { |
|
| 116 | 116 | /** @var Request $request */ |
| 117 | 117 | $request = $message->getMeta()['request']; |
| 118 | 118 | $subscribedFilters = $message->getMeta()['arguments'] ?? []; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | array_walk_recursive( |
| 162 | 162 | $data, |
| 163 | - function (&$value) { |
|
| 163 | + function(&$value) { |
|
| 164 | 164 | if ($value instanceof NodeInterface) { |
| 165 | 165 | $value = IDEncoder::encode($value); |
| 166 | 166 | } |
@@ -19,8 +19,7 @@ |
||
| 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 | ") |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | try { |
| 118 | 118 | $this->consumer->subscribe( |
| 119 | 119 | $channels, |
| 120 | - function (\Redis $redis, $chan, $event) use ($dispatch) { |
|
| 120 | + function(\Redis $redis, $chan, $event) use ($dispatch) { |
|
| 121 | 121 | while ($keys = $this->client->scan($iterator, "*$chan:*", 100)) { |
| 122 | 122 | [$filters, $data] = unserialize($event, [true]); |
| 123 | 123 | foreach ($keys as $key) { |
@@ -51,51 +51,51 @@ discard block |
||
| 51 | 51 | protected function configureSubscriptions(NodeBuilder $root) |
| 52 | 52 | { |
| 53 | 53 | $subscriptions = $root->arrayNode('subscriptions') |
| 54 | - ->info('Manage subscriptions settings') |
|
| 55 | - ->addDefaultsIfNotSet() |
|
| 56 | - ->children(); |
|
| 54 | + ->info('Manage subscriptions settings') |
|
| 55 | + ->addDefaultsIfNotSet() |
|
| 56 | + ->children(); |
|
| 57 | 57 | |
| 58 | 58 | $subscriptions->scalarNode('ttl')->defaultValue(Subscriber::DEFAULT_SUBSCRIPTION_TTL) |
| 59 | - ->info('Time to live for subscriptions. The subscription will be deleted after this time, a heartbeat is required to keep-alive'); |
|
| 59 | + ->info('Time to live for subscriptions. The subscription will be deleted after this time, a heartbeat is required to keep-alive'); |
|
| 60 | 60 | $subscriptions->scalarNode('mercure_hub')->defaultValue('default'); |
| 61 | 61 | $subscriptions->scalarNode('pubsub_handler')->defaultValue(RedisPubSubHandler::class); |
| 62 | 62 | $redis = $subscriptions->arrayNode('redis')->info('Configure redis server to use as subscription handler') |
| 63 | - ->addDefaultsIfNotSet() |
|
| 64 | - ->children(); |
|
| 63 | + ->addDefaultsIfNotSet() |
|
| 64 | + ->children(); |
|
| 65 | 65 | |
| 66 | 66 | $redis->scalarNode('host')->defaultValue('localhost'); |
| 67 | 67 | $redis->integerNode('port')->defaultValue(6379); |
| 68 | 68 | $redis->integerNode('prefix')->defaultValue('GraphQLSubscription:') |
| 69 | - ->info('Define custom prefix to avoid collisions between applications'); |
|
| 69 | + ->info('Define custom prefix to avoid collisions between applications'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | protected function configureErrorHandling(NodeBuilder $root) |
| 73 | 73 | { |
| 74 | 74 | $errorHandling = $root->arrayNode('error_handling') |
| 75 | - ->info('It is important to handle errors and when possible, report these errors back to your users for information. ') |
|
| 76 | - ->addDefaultsIfNotSet() |
|
| 77 | - ->children(); |
|
| 75 | + ->info('It is important to handle errors and when possible, report these errors back to your users for information. ') |
|
| 76 | + ->addDefaultsIfNotSet() |
|
| 77 | + ->children(); |
|
| 78 | 78 | |
| 79 | 79 | $errorHandling->enumNode('validation_messages') |
| 80 | - ->values(['error', 'payload', 'both']) |
|
| 81 | - ->info('Where should be displayed validation messages.') |
|
| 82 | - ->defaultValue('error'); |
|
| 80 | + ->values(['error', 'payload', 'both']) |
|
| 81 | + ->info('Where should be displayed validation messages.') |
|
| 82 | + ->defaultValue('error'); |
|
| 83 | 83 | |
| 84 | 84 | //@deprecated since v1.1 snd should be deleted in 2.0, this is a compatibility flag |
| 85 | 85 | $errorHandling->booleanNode('jwt_auth_failure_compatibility') |
| 86 | - ->info('Keep BC with oldest version of JWT Authentication errors') |
|
| 87 | - ->setDeprecated('Since v1.1 and will will be removed in the next mayor release') |
|
| 88 | - ->defaultFalse(); |
|
| 86 | + ->info('Keep BC with oldest version of JWT Authentication errors') |
|
| 87 | + ->setDeprecated('Since v1.1 and will will be removed in the next mayor release') |
|
| 88 | + ->defaultFalse(); |
|
| 89 | 89 | |
| 90 | 90 | $errorHandling->booleanNode('show_trace')->info('Show error trace in debug mode')->defaultFalse(); |
| 91 | 91 | |
| 92 | 92 | $errorHandling->scalarNode('formatter') |
| 93 | - ->info('Formatter is responsible for converting instances of Error to an array') |
|
| 94 | - ->defaultValue(DefaultErrorFormatter::class); |
|
| 93 | + ->info('Formatter is responsible for converting instances of Error to an array') |
|
| 94 | + ->defaultValue(DefaultErrorFormatter::class); |
|
| 95 | 95 | |
| 96 | 96 | $errorHandling->scalarNode('handler') |
| 97 | - ->info('Handler is useful for error filtering and logging.') |
|
| 98 | - ->defaultValue(DefaultErrorHandler::class); |
|
| 97 | + ->info('Handler is useful for error filtering and logging.') |
|
| 98 | + ->defaultValue(DefaultErrorHandler::class); |
|
| 99 | 99 | |
| 100 | 100 | $controlledErrors = $errorHandling |
| 101 | 101 | ->arrayNode('controlled_errors') |
@@ -181,44 +181,44 @@ discard block |
||
| 181 | 181 | protected function configureEndpoints(NodeBuilder $root) |
| 182 | 182 | { |
| 183 | 183 | $endpoints = $root->arrayNode('endpoints') |
| 184 | - ->useAttributeAsKey('name') |
|
| 185 | - ->validate() |
|
| 186 | - ->ifTrue( |
|
| 187 | - function ($v) { |
|
| 188 | - return array_key_exists('default', $v); |
|
| 189 | - } |
|
| 190 | - )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.') |
|
| 191 | - ->end() |
|
| 192 | - ->arrayPrototype() |
|
| 193 | - ->children(); |
|
| 184 | + ->useAttributeAsKey('name') |
|
| 185 | + ->validate() |
|
| 186 | + ->ifTrue( |
|
| 187 | + function ($v) { |
|
| 188 | + return array_key_exists('default', $v); |
|
| 189 | + } |
|
| 190 | + )->thenInvalid('"default" can\'t be used as endpoint name, the system internally use this endpoint name to store the entire schema.') |
|
| 191 | + ->end() |
|
| 192 | + ->arrayPrototype() |
|
| 193 | + ->children(); |
|
| 194 | 194 | |
| 195 | 195 | $endpoints->arrayNode('roles') |
| 196 | - ->beforeNormalization() |
|
| 197 | - ->ifString() |
|
| 198 | - ->then( |
|
| 199 | - function ($v) { |
|
| 200 | - return preg_split('/\s*,\s*/', $v); |
|
| 201 | - } |
|
| 202 | - ) |
|
| 203 | - ->end() |
|
| 204 | - ->prototype('scalar') |
|
| 205 | - ->end(); |
|
| 196 | + ->beforeNormalization() |
|
| 197 | + ->ifString() |
|
| 198 | + ->then( |
|
| 199 | + function ($v) { |
|
| 200 | + return preg_split('/\s*,\s*/', $v); |
|
| 201 | + } |
|
| 202 | + ) |
|
| 203 | + ->end() |
|
| 204 | + ->prototype('scalar') |
|
| 205 | + ->end(); |
|
| 206 | 206 | |
| 207 | 207 | $endpoints->scalarNode('host')->example('^api\.backend\.'); |
| 208 | 208 | $endpoints->scalarNode('path')->example('/backend'); |
| 209 | 209 | |
| 210 | 210 | $root->arrayNode('endpoint_alias') |
| 211 | - ->info('Use alias to refer to multiple endpoints using only one name') |
|
| 212 | - ->useAttributeAsKey('name') |
|
| 213 | - ->beforeNormalization() |
|
| 214 | - ->ifString() |
|
| 215 | - ->then( |
|
| 216 | - function ($v) { |
|
| 217 | - return preg_split('/\s*,\s*/', $v); |
|
| 218 | - } |
|
| 219 | - ) |
|
| 220 | - ->end() |
|
| 221 | - ->variablePrototype(); |
|
| 211 | + ->info('Use alias to refer to multiple endpoints using only one name') |
|
| 212 | + ->useAttributeAsKey('name') |
|
| 213 | + ->beforeNormalization() |
|
| 214 | + ->ifString() |
|
| 215 | + ->then( |
|
| 216 | + function ($v) { |
|
| 217 | + return preg_split('/\s*,\s*/', $v); |
|
| 218 | + } |
|
| 219 | + ) |
|
| 220 | + ->end() |
|
| 221 | + ->variablePrototype(); |
|
| 222 | 222 | |
| 223 | 223 | $root->scalarNode('endpoint_default')->info('Endpoint to apply to all definitions without explicit endpoint.'); |
| 224 | 224 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $graphiql = $root->arrayNode('graphiql')->addDefaultsIfNotSet()->children(); |
| 230 | 230 | |
| 231 | 231 | $graphiql->scalarNode('title') |
| 232 | - ->defaultValue('GraphQL API Explorer'); |
|
| 232 | + ->defaultValue('GraphQL API Explorer'); |
|
| 233 | 233 | |
| 234 | 234 | $graphiql |
| 235 | 235 | ->scalarNode('data_warning_message') |
@@ -257,61 +257,61 @@ discard block |
||
| 257 | 257 | ->defaultFalse(); |
| 258 | 258 | |
| 259 | 259 | $authentication->scalarNode('login_message') |
| 260 | - ->defaultValue('Start exploring GraphQL API queries using your account’s data now.'); |
|
| 260 | + ->defaultValue('Start exploring GraphQL API queries using your account’s data now.'); |
|
| 261 | 261 | |
| 262 | 262 | $authenticationProvider = $authentication->arrayNode('provider')->children(); |
| 263 | 263 | |
| 264 | 264 | //the updated version of `jwt` to use lexik authentication bundle |
| 265 | 265 | $lexikJwt = $authenticationProvider->arrayNode('lexik_jwt') |
| 266 | - ->canBeEnabled() |
|
| 267 | - ->children(); |
|
| 266 | + ->canBeEnabled() |
|
| 267 | + ->children(); |
|
| 268 | 268 | |
| 269 | 269 | $lexikJwt->scalarNode('user_provider') |
| 270 | - ->isRequired() |
|
| 271 | - ->info('Name of the user provider to use'); |
|
| 270 | + ->isRequired() |
|
| 271 | + ->info('Name of the user provider to use'); |
|
| 272 | 272 | |
| 273 | 273 | $lexikJwt->scalarNode('username_label') |
| 274 | - ->defaultValue('Username'); |
|
| 274 | + ->defaultValue('Username'); |
|
| 275 | 275 | |
| 276 | 276 | $lexikJwt->scalarNode('password_label') |
| 277 | - ->defaultValue('Password'); |
|
| 277 | + ->defaultValue('Password'); |
|
| 278 | 278 | |
| 279 | 279 | $authenticationProvider->scalarNode('custom') |
| 280 | - ->defaultNull() |
|
| 281 | - ->info('Configure custom service to use as authentication provider'); |
|
| 280 | + ->defaultNull() |
|
| 281 | + ->info('Configure custom service to use as authentication provider'); |
|
| 282 | 282 | |
| 283 | 283 | //deprecated since v1.1 and should be deleted in v2.0 |
| 284 | 284 | $jwt = $authenticationProvider->arrayNode('jwt') |
| 285 | - ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.') |
|
| 286 | - ->canBeEnabled() |
|
| 287 | - ->children(); |
|
| 285 | + ->setDeprecated('Use lexik_jwt instead, this provider will be removed in the next mayor release.') |
|
| 286 | + ->canBeEnabled() |
|
| 287 | + ->children(); |
|
| 288 | 288 | |
| 289 | 289 | $jwtLogin = $jwt->arrayNode('login')->children(); |
| 290 | 290 | |
| 291 | 291 | $jwtLogin->scalarNode('url') |
| 292 | - ->info('Route name or URI to make the login process to retrieve the token.') |
|
| 293 | - ->isRequired(); |
|
| 292 | + ->info('Route name or URI to make the login process to retrieve the token.') |
|
| 293 | + ->isRequired(); |
|
| 294 | 294 | |
| 295 | 295 | $jwtLogin->scalarNode('username_parameter') |
| 296 | - ->defaultValue('username'); |
|
| 296 | + ->defaultValue('username'); |
|
| 297 | 297 | |
| 298 | 298 | $jwtLogin->scalarNode('username_label') |
| 299 | - ->defaultValue('Username'); |
|
| 299 | + ->defaultValue('Username'); |
|
| 300 | 300 | |
| 301 | 301 | $jwtLogin->scalarNode('password_parameter') |
| 302 | - ->defaultValue('password'); |
|
| 302 | + ->defaultValue('password'); |
|
| 303 | 303 | |
| 304 | 304 | $jwtLogin->scalarNode('password_label') |
| 305 | - ->defaultValue('Password'); |
|
| 305 | + ->defaultValue('Password'); |
|
| 306 | 306 | |
| 307 | 307 | $jwtLogin->enumNode('parameters_in') |
| 308 | - ->values(['form', 'query', 'header']) |
|
| 309 | - ->info('How pass parameters to request the token') |
|
| 310 | - ->defaultValue('form'); |
|
| 308 | + ->values(['form', 'query', 'header']) |
|
| 309 | + ->info('How pass parameters to request the token') |
|
| 310 | + ->defaultValue('form'); |
|
| 311 | 311 | |
| 312 | 312 | $jwtLogin->scalarNode('response_token_path') |
| 313 | - ->defaultValue('token') |
|
| 314 | - ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.'); |
|
| 313 | + ->defaultValue('token') |
|
| 314 | + ->info('Where the token should be located in the response in case of JSON, set null if the response is the token.'); |
|
| 315 | 315 | |
| 316 | 316 | $jwtRequests = $jwt->arrayNode('requests')->addDefaultsIfNotSet()->children(); |
| 317 | 317 | |
@@ -350,25 +350,25 @@ discard block |
||
| 350 | 350 | { |
| 351 | 351 | $pagination = $root->arrayNode('pagination')->addDefaultsIfNotSet()->children(); |
| 352 | 352 | $pagination->integerNode('limit') |
| 353 | - ->defaultValue(100)->info('Maximum limit allowed for all paginations'); |
|
| 353 | + ->defaultValue(100)->info('Maximum limit allowed for all paginations'); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | protected function configurePluginNamespaceGlobalConfig(NodeBuilder $root) |
| 357 | 357 | { |
| 358 | 358 | $namespaces = $root->arrayNode('namespaces') |
| 359 | - ->info( |
|
| 360 | - 'Group GraphQL schema using namespaced schemas. |
|
| 359 | + ->info( |
|
| 360 | + 'Group GraphQL schema using namespaced schemas. |
|
| 361 | 361 | On large schemas is helpful to keep schemas grouped by bundle and node' |
| 362 | - ) |
|
| 363 | - ->canBeEnabled() |
|
| 364 | - ->addDefaultsIfNotSet() |
|
| 365 | - ->children(); |
|
| 362 | + ) |
|
| 363 | + ->canBeEnabled() |
|
| 364 | + ->addDefaultsIfNotSet() |
|
| 365 | + ->children(); |
|
| 366 | 366 | |
| 367 | 367 | $bundles = $namespaces->arrayNode('bundles') |
| 368 | - ->info('Group each bundle into a separate schema definition') |
|
| 369 | - ->canBeDisabled() |
|
| 370 | - ->addDefaultsIfNotSet() |
|
| 371 | - ->children(); |
|
| 368 | + ->info('Group each bundle into a separate schema definition') |
|
| 369 | + ->canBeDisabled() |
|
| 370 | + ->addDefaultsIfNotSet() |
|
| 371 | + ->children(); |
|
| 372 | 372 | |
| 373 | 373 | $bundles->scalarNode('query_suffix') |
| 374 | 374 | ->info('The following suffix will be used for bundle query groups') |
@@ -403,29 +403,29 @@ discard block |
||
| 403 | 403 | ->children(); |
| 404 | 404 | |
| 405 | 405 | $nodes->scalarNode('query_suffix') |
| 406 | - ->info('The following suffix will be used to create the name for queries to the same node') |
|
| 407 | - ->defaultValue('Query'); |
|
| 406 | + ->info('The following suffix will be used to create the name for queries to the same node') |
|
| 407 | + ->defaultValue('Query'); |
|
| 408 | 408 | |
| 409 | 409 | $nodes->scalarNode('mutation_suffix') |
| 410 | - ->info('The following suffix will be used to create the name for mutations to the same node') |
|
| 411 | - ->defaultValue('Mutation'); |
|
| 410 | + ->info('The following suffix will be used to create the name for mutations to the same node') |
|
| 411 | + ->defaultValue('Mutation'); |
|
| 412 | 412 | |
| 413 | 413 | $nodes->scalarNode('subscription_suffix') |
| 414 | - ->info('The following suffix will be used to create the name for subscriptions to the same node') |
|
| 415 | - ->defaultValue('Subscriptions'); |
|
| 414 | + ->info('The following suffix will be used to create the name for subscriptions to the same node') |
|
| 415 | + ->defaultValue('Subscriptions'); |
|
| 416 | 416 | |
| 417 | 417 | $nodes->variableNode('ignore') |
| 418 | - ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation') |
|
| 419 | - ->defaultValue(['Node']); |
|
| 418 | + ->info('The following nodes will be ignore for grouping, all definitions will be placed in the root query or mutation') |
|
| 419 | + ->defaultValue(['Node']); |
|
| 420 | 420 | |
| 421 | 421 | $nodes->arrayNode('aliases') |
| 422 | - ->info( |
|
| 423 | - 'Define aliases for nodes to set definitions inside other desired node name. |
|
| 422 | + ->info( |
|
| 423 | + 'Define aliases for nodes to set definitions inside other desired node name. |
|
| 424 | 424 | Can be used to group multiple nodes or publish a node with a different group name' |
| 425 | - ) |
|
| 426 | - ->example('InvoiceItem: Invoice') |
|
| 427 | - ->useAttributeAsKey('name') |
|
| 428 | - ->prototype('scalar'); |
|
| 425 | + ) |
|
| 426 | + ->example('InvoiceItem: Invoice') |
|
| 427 | + ->useAttributeAsKey('name') |
|
| 428 | + ->prototype('scalar'); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | private function configureSecurity(NodeBuilder $rootNode) |
@@ -471,13 +471,13 @@ discard block |
||
| 471 | 471 | ->children(); |
| 472 | 472 | |
| 473 | 473 | $bcNode->variableNode('filters') |
| 474 | - ->info('Keep deprecated "filters" argument in collections') |
|
| 475 | - ->setDeprecated('v1.2') |
|
| 476 | - ->defaultFalse(); |
|
| 474 | + ->info('Keep deprecated "filters" argument in collections') |
|
| 475 | + ->setDeprecated('v1.2') |
|
| 476 | + ->defaultFalse(); |
|
| 477 | 477 | |
| 478 | 478 | $bcNode->variableNode('orderBy') |
| 479 | - ->info('Keep deprecated "orderBy" argument in collections') |
|
| 480 | - ->setDeprecated('v1.2') |
|
| 481 | - ->defaultFalse(); |
|
| 479 | + ->info('Keep deprecated "orderBy" argument in collections') |
|
| 480 | + ->setDeprecated('v1.2') |
|
| 481 | + ->defaultFalse(); |
|
| 482 | 482 | } |
| 483 | 483 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if ($config['graphiql']['authentication']['provider']['lexik_jwt']['enabled'] ?? false) { |
| 106 | 106 | $providerName = sprintf('security.user.provider.concrete.%s', $config['graphiql']['authentication']['provider']['lexik_jwt']['user_provider']); |
| 107 | 107 | $container->getDefinition(LexikJWTGraphiQLAuthenticator::class) |
| 108 | - ->setArgument(1, new Reference($providerName)); |
|
| 108 | + ->setArgument(1, new Reference($providerName)); |
|
| 109 | 109 | } else { |
| 110 | 110 | $container->removeDefinition(LexikJWTGraphiQLAuthenticator::class); |
| 111 | 111 | } |
@@ -114,14 +114,14 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | //build the ID encoder manager with configured encoder |
| 116 | 116 | $container->getDefinition(IDEncoderManager::class) |
| 117 | - ->setPublic(true) |
|
| 118 | - ->replaceArgument(0, $container->getDefinition($config['id_encoder'])); |
|
| 117 | + ->setPublic(true) |
|
| 118 | + ->replaceArgument(0, $container->getDefinition($config['id_encoder'])); |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | //endpoint definition |
| 122 | 122 | $container->getDefinition(GraphQLEndpointController::class) |
| 123 | - ->addMethodCall('setErrorFormatter', [$container->getDefinition($config['error_handling']['formatter'])]) |
|
| 124 | - ->addMethodCall('setErrorHandler', [$container->getDefinition($config['error_handling']['handler'])]); |
|
| 123 | + ->addMethodCall('setErrorFormatter', [$container->getDefinition($config['error_handling']['formatter'])]) |
|
| 124 | + ->addMethodCall('setErrorHandler', [$container->getDefinition($config['error_handling']['handler'])]); |
|
| 125 | 125 | |
| 126 | 126 | $bundles = $container->getParameter('kernel.bundles'); |
| 127 | 127 | if (isset($bundles['MercureBundle'])) { |
@@ -130,19 +130,19 @@ discard block |
||
| 130 | 130 | $mercurePublisherReference = new Reference(sprintf('mercure.hub.%s.publisher', $mercureHub)); |
| 131 | 131 | |
| 132 | 132 | $container->getDefinition(SubscriptionManager::class) |
| 133 | - ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 134 | - ->addArgument(new Parameter('kernel.secret')); |
|
| 133 | + ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 134 | + ->addArgument(new Parameter('kernel.secret')); |
|
| 135 | 135 | |
| 136 | 136 | $container->getDefinition(SubscriptionsController::class) |
| 137 | - ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 138 | - ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 137 | + ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 138 | + ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 139 | 139 | |
| 140 | 140 | $container->getDefinition(SubscriptionsHeartbeatController::class) |
| 141 | - ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 142 | - ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 141 | + ->addArgument($container->getDefinition($config['subscriptions']['pubsub_handler'])) |
|
| 142 | + ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 143 | 143 | |
| 144 | 144 | $container->getDefinition(SubscriptionConsumerCommand::class) |
| 145 | - ->addArgument($mercurePublisherReference); |
|
| 145 | + ->addArgument($mercurePublisherReference); |
|
| 146 | 146 | |
| 147 | 147 | $container->getDefinition(GraphQLEndpointController::class)->addMethodCall('setPublisher', [$mercurePublisherReference]); |
| 148 | 148 | } else { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $container->setParameter('graphql.namespaces', $config['namespaces'] ?? []); |
| 60 | 60 | $container->setParameter('graphql.cors_config', $config['cors'] ?? []); |
| 61 | 61 | $container->setParameter('graphql.graphiql', $config['graphiql'] ?? []); |
| 62 | - $container->setParameter('graphql.graphiql_auth_jwt', $config['graphiql']['authentication']['provider']['jwt'] ?? []);//DEPRECATED |
|
| 62 | + $container->setParameter('graphql.graphiql_auth_jwt', $config['graphiql']['authentication']['provider']['jwt'] ?? []); //DEPRECATED |
|
| 63 | 63 | $container->setParameter('graphql.graphiql_auth_lexik_jwt', $config['graphiql']['authentication']['provider']['lexik_jwt'] ?? []); |
| 64 | 64 | $container->setParameter('graphql.security.validation_rules', $config['security']['validation_rules'] ?? []); |
| 65 | 65 | $container->setParameter('graphql.subscriptions.redis', $config['subscriptions']['redis'] ?? []); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $defaults = [ |
| 24 | 24 | 'name' => 'Subscription', |
| 25 | - 'fields' => function () { |
|
| 25 | + 'fields' => function() { |
|
| 26 | 26 | $subscriptions = []; |
| 27 | 27 | foreach ($this->endpoint->allSubscriptions() as $subscription) { |
| 28 | 28 | $subscriptions[$subscription->getName()] = $this->getQueryConfig($subscription); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | [ |
| 32 | 32 | 'name' => $definition->getName(), |
| 33 | 33 | 'description' => $definition->getDescription(), |
| 34 | - 'types' => function () use ($definition) { |
|
| 34 | + 'types' => function() use ($definition) { |
|
| 35 | 35 | $types = []; |
| 36 | 36 | $unionTypes = $definition->getTypes(); |
| 37 | 37 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | return $types; |
| 72 | 72 | }, |
| 73 | - 'resolveType' => function ($value) { |
|
| 73 | + 'resolveType' => function($value) { |
|
| 74 | 74 | $type = TypeUtil::resolveObjectType($this->endpoint, $value); |
| 75 | 75 | if (!$type) { |
| 76 | 76 | throw new \RuntimeException(sprintf('Can`t resolve a valid type for object of class %s.', get_class($value))); |
@@ -52,12 +52,12 @@ |
||
| 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); |
@@ -41,12 +41,12 @@ |
||
| 41 | 41 | 'resolveField' => function ($root, array $args, ResolverContext $context, ResolveInfo $resolveInfo) use ($definition) { |
| 42 | 42 | $resolver = new ObjectFieldResolver($this->container); |
| 43 | 43 | $context = ContextBuilder::create($context->getEndpoint()) |
| 44 | - ->setRoot($root) |
|
| 45 | - ->setResolveInfo($resolveInfo) |
|
| 46 | - ->setArgs($args) |
|
| 47 | - ->setMetas($context->getMetas()) |
|
| 48 | - ->setDefinition($definition->getField($resolveInfo->fieldName)) |
|
| 49 | - ->build(); |
|
| 44 | + ->setRoot($root) |
|
| 45 | + ->setResolveInfo($resolveInfo) |
|
| 46 | + ->setArgs($args) |
|
| 47 | + ->setMetas($context->getMetas()) |
|
| 48 | + ->setDefinition($definition->getField($resolveInfo->fieldName)) |
|
| 49 | + ->build(); |
|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | return $resolver($root, $args, $context, $resolveInfo); |