@@ -236,8 +236,7 @@ |
||
236 | 236 | // Mark the query as such and sort by the revision id too. |
237 | 237 | $query->allRevisions(); |
238 | 238 | $query->addTag('revisions'); |
239 | - } |
|
240 | - else if ($mode === 'latest') { |
|
239 | + } else if ($mode === 'latest') { |
|
241 | 240 | // Mark the query to only include latest revision and sort by revision id. |
242 | 241 | $query->latestRevision(); |
243 | 242 | $query->addTag('revisions'); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | if (isset($metadata['ids']) && $sorting = $metadata['ids']) { |
113 | 113 | $sorting = array_flip(array_values($sorting)); |
114 | - uasort($result, function ($a, $b) use ($sorting) { |
|
114 | + uasort($result, function($a, $b) use ($sorting) { |
|
115 | 115 | return $sorting[$a] - $sorting[$b]; |
116 | 116 | }); |
117 | 117 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | protected function resolveFromEntityIds($type, $ids, $metadata, array $args, ResolveContext $context, ResolveInfo $info) { |
148 | 148 | $resolve = $this->entityBuffer->add($type, $ids); |
149 | 149 | return function($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve, $metadata) { |
150 | - return $this->resolveEntities($resolve(), $metadata, $args, $context, $info); |
|
150 | + return $this->resolveEntities($resolve(), $metadata, $args, $context, $info); |
|
151 | 151 | }; |
152 | 152 | } |
153 | 153 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function resolveFromRevisionIds($type, $ids, $metadata, array $args, ResolveContext $context, ResolveInfo $info) { |
174 | 174 | $storage = $this->entityTypeManager->getStorage($type); |
175 | - $entities = array_map(function ($id) use ($storage) { |
|
175 | + $entities = array_map(function($id) use ($storage) { |
|
176 | 176 | return $storage->loadRevision($id); |
177 | 177 | }, $ids); |
178 | 178 |
@@ -211,8 +211,7 @@ |
||
211 | 211 | $access = $entity->access('view', NULL, TRUE); |
212 | 212 | if ($access->isAllowed()) { |
213 | 213 | yield $entity->addCacheableDependency($access); |
214 | - } |
|
215 | - else { |
|
214 | + } else { |
|
216 | 215 | yield new CacheableValue(NULL, [$access]); |
217 | 216 | } |
218 | 217 | } |
@@ -96,12 +96,12 @@ |
||
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 | $links = $this->breadcrumbManager->build($this->routeMatch)->getLinks(); |
101 | 101 | return $links; |
102 | 102 | }); |
103 | 103 | |
104 | - return function ($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
104 | + return function($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
105 | 105 | /** @var \Drupal\graphql\GraphQL\Cache\CacheableValue $response */ |
106 | 106 | $response = $resolve(); |
107 | 107 | $links = $response->getValue(); |
@@ -84,13 +84,13 @@ |
||
84 | 84 | $value = Url::fromRoute('<front>'); |
85 | 85 | } |
86 | 86 | |
87 | - $resolve = $this->subRequestBuffer->add($value, function () { |
|
87 | + $resolve = $this->subRequestBuffer->add($value, function() { |
|
88 | 88 | $id = $this->getPluginDefinition()['context_id']; |
89 | 89 | $contexts = $this->contextRepository->getRuntimeContexts([$id]); |
90 | 90 | return isset($contexts[$id]) ? $contexts[$id]->getContextValue() : NULL; |
91 | 91 | }); |
92 | 92 | |
93 | - return function ($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
93 | + return function($value, array $args, ResolveContext $context, ResolveInfo $info) use ($resolve) { |
|
94 | 94 | yield $resolve(); |
95 | 95 | }; |
96 | 96 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'input' => 'NodeInput', |
89 | 89 | ], |
90 | 90 | 'type' => 'EntityCrudOutput', |
91 | - ], function ($source, $args, $context, $info) { |
|
91 | + ], function($source, $args, $context, $info) { |
|
92 | 92 | return [ |
93 | 93 | 'title' => $args['input']['title'], |
94 | 94 | 'status' => 1, |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'input' => 'NodeInput', |
127 | 127 | ], |
128 | 128 | 'type' => 'EntityCrudOutput', |
129 | - ], function ($source, $args, $context, $info) { |
|
129 | + ], function($source, $args, $context, $info) { |
|
130 | 130 | return [ |
131 | 131 | 'status' => 1, |
132 | 132 | 'body' => [ |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'input' => 'NodeInput', |
168 | 168 | ], |
169 | 169 | 'type' => 'EntityCrudOutput', |
170 | - ], function ($source, $args, $context, $info) { |
|
170 | + ], function($source, $args, $context, $info) { |
|
171 | 171 | return [ |
172 | 172 | 'title' => $args['input']['title'], |
173 | 173 | ]; |
@@ -43,8 +43,7 @@ |
||
43 | 43 | $this->installEntitySchema('block_content'); |
44 | 44 | try { |
45 | 45 | $this->installEntitySchema('path_alias'); |
46 | - } |
|
47 | - catch (PluginNotFoundException $exc) { |
|
46 | + } catch (PluginNotFoundException $exc) { |
|
48 | 47 | // Ignore if the path_alias entity doesn't exist. This means we are |
49 | 48 | // testing a Drupal version < 8.8 and aliases are not entities yet. |
50 | 49 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | $breadcrumbManager = $this->prophesize('Drupal\Core\Breadcrumb\BreadcrumbManager'); |
32 | 32 | $breadcrumbManager->build(Argument::any()) |
33 | - ->will(function ($args) { |
|
33 | + ->will(function($args) { |
|
34 | 34 | /** @var \Drupal\Core\Routing\RouteMatch $routeMatch */ |
35 | 35 | $routeMatch = $args[0]; |
36 | 36 | $breadcrumb = new Breadcrumb(); |
@@ -47,8 +47,7 @@ |
||
47 | 47 | /** @var \Drupal\file\FileInterface $file */ |
48 | 48 | if (empty($files) || !($file = reset($files)) || !($file instanceof FileInterface)) { |
49 | 49 | $formState->setError($form['query_map_json'], $this->t('No file was uploaded.')); |
50 | - } |
|
51 | - else { |
|
50 | + } else { |
|
52 | 51 | // Save the file for use in the submit handler. |
53 | 52 | $formState->set('file', $file); |
54 | 53 | $map = file_get_contents($file->getFileUri()); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function resolveBufferArray(array $buffer) { |
57 | 57 | $type = reset($buffer)['type']; |
58 | - $ids = array_map(function (\ArrayObject $item) { |
|
58 | + $ids = array_map(function(\ArrayObject $item) { |
|
59 | 59 | return (array) $item['id']; |
60 | 60 | }, $buffer); |
61 | 61 | |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | ->getStorage($type) |
68 | 68 | ->loadMultiple($ids); |
69 | 69 | |
70 | - return array_map(function ($item) use ($entities) { |
|
70 | + return array_map(function($item) use ($entities) { |
|
71 | 71 | if (is_array($item['id'])) { |
72 | - return array_reduce($item['id'], function ($carry, $current) use ($entities) { |
|
72 | + return array_reduce($item['id'], function($carry, $current) use ($entities) { |
|
73 | 73 | if (!empty($entities[$current])) { |
74 | 74 | return $carry + [$current => $entities[$current]]; |
75 | 75 | } |