@@ -138,8 +138,7 @@ |
||
| 138 | 138 | $access = $entity->access('view', NULL, TRUE); |
| 139 | 139 | if ($access->isAllowed()) { |
| 140 | 140 | yield $entity->addCacheableDependency($access); |
| 141 | - } |
|
| 142 | - else { |
|
| 141 | + } else { |
|
| 143 | 142 | yield new CacheableValue(NULL, [$access]); |
| 144 | 143 | } |
| 145 | 144 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 98 | 98 | if ($value instanceof Url) { |
| 99 | - $resolve = $this->subRequestBuffer->add($value, function () { |
|
| 99 | + $resolve = $this->subRequestBuffer->add($value, function() { |
|
| 100 | 100 | $request = $this->requestStack->getCurrentRequest()->duplicate(); |
| 101 | 101 | $request->attributes->set('_controller', $request->get('_graphql_controller')); |
| 102 | 102 | $request->attributes->remove('_graphql_subrequest'); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | return $response; |
| 115 | 115 | }); |
| 116 | 116 | |
| 117 | - return function ($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
| 117 | + return function($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
| 118 | 118 | /** @var \Drupal\graphql\GraphQL\Cache\CacheableValue $response */ |
| 119 | 119 | $response = $resolve(); |
| 120 | 120 | yield new CacheableValue($response->getValue(), [$response]); |
@@ -30,8 +30,7 @@ |
||
| 30 | 30 | protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 31 | 31 | if ($value instanceof Response) { |
| 32 | 32 | yield $value->headers->get($args['key']); |
| 33 | - } |
|
| 34 | - else if ($value instanceof ResponseInterface) { |
|
| 33 | + } else if ($value instanceof ResponseInterface) { |
|
| 35 | 34 | yield implode(";", $value->getHeader($args['key'])); |
| 36 | 35 | } |
| 37 | 36 | } |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 28 | 28 | if ($value instanceof Response) { |
| 29 | 29 | yield $value->getStatusCode(); |
| 30 | - } |
|
| 31 | - else if ($value instanceof ResponseInterface) { |
|
| 30 | + } else if ($value instanceof ResponseInterface) { |
|
| 32 | 31 | yield $value->getStatusCode(); |
| 33 | 32 | } |
| 34 | 33 | } |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 28 | 28 | if ($value instanceof Response) { |
| 29 | 29 | yield $value->getContent(); |
| 30 | - } |
|
| 31 | - else if ($value instanceof ResponseInterface) { |
|
| 30 | + } else if ($value instanceof ResponseInterface) { |
|
| 32 | 31 | yield (string) $value->getBody(); |
| 33 | 32 | } |
| 34 | 33 | } |
@@ -126,8 +126,7 @@ discard block |
||
| 126 | 126 | if ($this->languageManager->isMultilingual() && $this->languageNegotiator) { |
| 127 | 127 | if ($negotiator = $this->languageNegotiator->getNegotiationMethodInstance('language-url')) { |
| 128 | 128 | $context->setContext('language', $negotiator->getLangcode(Request::create($args['path'])), $info); |
| 129 | - } |
|
| 130 | - else { |
|
| 129 | + } else { |
|
| 131 | 130 | $context->setContext('language', $this->languageManager->getDefaultLanguage()->getId(), $info); |
| 132 | 131 | } |
| 133 | 132 | } |
@@ -163,8 +162,7 @@ discard block |
||
| 163 | 162 | |
| 164 | 163 | if (($url = $this->pathValidator->getUrlIfValidWithoutAccessCheck($args['path'])) && $url->access()) { |
| 165 | 164 | yield $url; |
| 166 | - } |
|
| 167 | - else { |
|
| 165 | + } else { |
|
| 168 | 166 | yield (new CacheableValue(NULL))->addCacheTags(['4xx-response']); |
| 169 | 167 | } |
| 170 | 168 | } |
@@ -83,8 +83,7 @@ |
||
| 83 | 83 | if ($style->supportsUri($file->getFileUri())) { |
| 84 | 84 | $style->transformDimensions($dimensions, $file->getFileUri()); |
| 85 | 85 | $url = $style->buildUrl($file->getFileUri()); |
| 86 | - } |
|
| 87 | - else { |
|
| 86 | + } else { |
|
| 88 | 87 | $url = $file->getFileUri(); |
| 89 | 88 | } |
| 90 | 89 | |
@@ -97,8 +97,7 @@ |
||
| 97 | 97 | |
| 98 | 98 | if (!$context->isEmpty()) { |
| 99 | 99 | yield new CacheableValue((string) $result, [$context->pop()]); |
| 100 | - } |
|
| 101 | - else { |
|
| 100 | + } else { |
|
| 102 | 101 | yield (string) $result; |
| 103 | 102 | } |
| 104 | 103 | } |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | */ |
| 99 | 99 | protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { |
| 100 | 100 | $resolver = $this->entityBuffer->add($this->getPluginDefinition()['entity_type'], $args['id']); |
| 101 | - return function ($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolver) { |
|
| 101 | + return function($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolver) { |
|
| 102 | 102 | if (!$entity = $resolver()) { |
| 103 | 103 | // If there is no entity with this id, add the list cache tags so that the |
| 104 | 104 | // cache entry is purged whenever a new entity of this type is saved. |
@@ -105,8 +105,7 @@ discard block |
||
| 105 | 105 | $pluginDefinition = $this->getPluginDefinition(); |
| 106 | 106 | $entityType = $this->entityTypeManager->getDefinition($pluginDefinition['entity_type']); |
| 107 | 107 | yield (new CacheableValue(NULL))->addCacheTags($entityType->getListCacheTags()); |
| 108 | - } |
|
| 109 | - else { |
|
| 108 | + } else { |
|
| 110 | 109 | /** @var \Drupal\Core\Entity\EntityInterface $entity */ |
| 111 | 110 | $access = $entity->access('view', NULL, TRUE); |
| 112 | 111 | |
@@ -118,8 +117,7 @@ discard block |
||
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | yield $entity->addCacheableDependency($access); |
| 121 | - } |
|
| 122 | - else { |
|
| 120 | + } else { |
|
| 123 | 121 | yield new CacheableValue(NULL, [$access]); |
| 124 | 122 | } |
| 125 | 123 | } |