@@ -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 |
@@ -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 | ]; |
@@ -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(); |
@@ -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 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | protected function createResolver($item, \SplObjectStorage $buffer, \SplObjectStorage $result) { |
74 | 74 | // Return the closure that will resolve and return the result for the item. |
75 | - return function () use ($item, $buffer, $result) { |
|
75 | + return function() use ($item, $buffer, $result) { |
|
76 | 76 | return $this->resolveItem($item, $buffer, $result); |
77 | 77 | }; |
78 | 78 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $current->server->all() |
99 | 99 | ); |
100 | 100 | |
101 | - $request->attributes->set('_graphql_subrequest', function () use ($buffer) { |
|
102 | - return array_map(function ($item) { |
|
101 | + $request->attributes->set('_graphql_subrequest', function() use ($buffer) { |
|
102 | + return array_map(function($item) { |
|
103 | 103 | return $item['extract']($item['url']); |
104 | 104 | }, $buffer); |
105 | 105 | }); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $response->addCacheableDependency($url); |
146 | 146 | } |
147 | 147 | |
148 | - return array_map(function ($value) use ($response) { |
|
148 | + return array_map(function($value) use ($response) { |
|
149 | 149 | return new CacheableValue($value, [$response]); |
150 | 150 | }, $response->getResult()); |
151 | 151 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | */ |
40 | 40 | public function __sleep() { |
41 | 41 | // TODO: Find a better way to solve this. |
42 | - return array_filter(array_keys(get_object_vars($this)), function ($prop) { |
|
42 | + return array_filter(array_keys(get_object_vars($this)), function($prop) { |
|
43 | 43 | return $prop != 'errors'; |
44 | 44 | }); |
45 | 45 | } |