@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $cursorOffset = $offset - 1; |
| 46 | 46 | foreach ($results as $result) { |
| 47 | - $cursorOffset ++; |
|
| 47 | + $cursorOffset++; |
|
| 48 | 48 | |
| 49 | 49 | if (!$this->connection->getPageInfo()->getStartCursor()) { |
| 50 | 50 | $this->connection->getPageInfo()->setStartCursor($this->encodeCursor($offset)); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if ($pagination->getLast()) { |
| 117 | 117 | $offset = $count - $pagination->getLast(); |
| 118 | 118 | if ($offset < $this->decodeCursor($pagination->getAfter())) { |
| 119 | - $offset = $this->decodeCursor($pagination->getAfter()) + 1; |
|
| 119 | + $offset = $this->decodeCursor($pagination->getAfter()) + 1; |
|
| 120 | 120 | } |
| 121 | 121 | } else { |
| 122 | 122 | $offset = $this->decodeCursor($pagination->getAfter()) + 1; |
@@ -84,12 +84,12 @@ |
||
| 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 | /** |
@@ -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 | ") |
@@ -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'] ?? []); |
@@ -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, new Reference($config['id_encoder'])); |
|
| 117 | + ->setPublic(true) |
|
| 118 | + ->replaceArgument(0, new Reference($config['id_encoder'])); |
|
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | //endpoint definition |
| 122 | 122 | $container->getDefinition(GraphQLEndpointController::class) |
| 123 | - ->addMethodCall('setErrorFormatter', [new Reference($config['error_handling']['formatter'])]) |
|
| 124 | - ->addMethodCall('setErrorHandler', [new Reference($config['error_handling']['handler'])]); |
|
| 123 | + ->addMethodCall('setErrorFormatter', [new Reference($config['error_handling']['formatter'])]) |
|
| 124 | + ->addMethodCall('setErrorHandler', [new Reference($config['error_handling']['handler'])]); |
|
| 125 | 125 | |
| 126 | 126 | $bundles = $container->getParameter('kernel.bundles'); |
| 127 | 127 | if (isset($bundles['MercureBundle']) && $config['subscriptions']['enabled']) { |
@@ -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(new Reference($config['subscriptions']['pubsub_handler'])) |
|
| 134 | - ->addArgument(new Parameter('kernel.secret')); |
|
| 133 | + ->addArgument(new Reference($config['subscriptions']['pubsub_handler'])) |
|
| 134 | + ->addArgument(new Parameter('kernel.secret')); |
|
| 135 | 135 | |
| 136 | 136 | $container->getDefinition(SubscriptionsController::class) |
| 137 | - ->addArgument(new Reference($config['subscriptions']['pubsub_handler'])) |
|
| 138 | - ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 137 | + ->addArgument(new Reference($config['subscriptions']['pubsub_handler'])) |
|
| 138 | + ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 139 | 139 | |
| 140 | 140 | $container->getDefinition(SubscriptionsHeartbeatController::class) |
| 141 | - ->addArgument(new Reference($config['subscriptions']['pubsub_handler'])) |
|
| 142 | - ->addMethodCall('setMercureHubUrl', [new Parameter('mercure.hubs'), $mercureHub]); |
|
| 141 | + ->addArgument(new Reference($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 { |
@@ -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))); |
@@ -57,7 +57,7 @@ |
||
| 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 | /** |
@@ -136,12 +136,12 @@ |
||
| 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); |