@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getLocationsAsArray(): ?array |
152 | 152 | { |
153 | - return !empty($this->locations) ? array_map(function (SourceLocation $location) { |
|
153 | + return !empty($this->locations) ? array_map(function(SourceLocation $location) { |
|
154 | 154 | return $location->toArray(); |
155 | 155 | }, $this->locations) : null; |
156 | 156 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | protected function resolvePositions(?array $positions) |
209 | 209 | { |
210 | 210 | if (null === $positions && !empty($this->nodes)) { |
211 | - $positions = array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
211 | + $positions = array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
212 | 212 | $location = $node->getLocation(); |
213 | 213 | if (null !== $location) { |
214 | 214 | $list[] = $location->getStart(); |
@@ -234,11 +234,11 @@ discard block |
||
234 | 234 | protected function resolveLocations(?array $positions, ?Source $source) |
235 | 235 | { |
236 | 236 | if (null !== $positions && null !== $source) { |
237 | - $locations = array_map(function ($position) use ($source) { |
|
237 | + $locations = array_map(function($position) use ($source) { |
|
238 | 238 | return SourceLocation::fromSource($source, $position); |
239 | 239 | }, $positions); |
240 | 240 | } elseif (!empty($this->nodes)) { |
241 | - $locations = array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
241 | + $locations = array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
242 | 242 | $location = $node->getLocation(); |
243 | 243 | if (null !== $location) { |
244 | 244 | $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart()); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $line < \count($lines) ? leftPad($padLen, $nextLineNum) . ': ' . $lines[$line] : null, |
63 | 63 | ]; |
64 | 64 | |
65 | - return implode("\n", array_filter($outputLines, function ($line) { |
|
65 | + return implode("\n", array_filter($outputLines, function($line) { |
|
66 | 66 | return null !== $line; |
67 | 67 | })); |
68 | 68 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | preg_match_all("/\r\n|[\n\r]/", mb_substr($source->getBody(), 0, $position), $matches, PREG_OFFSET_CAPTURE); |
60 | 60 | |
61 | 61 | foreach ($matches[0] as $index => $match) { |
62 | - $line += 1; |
|
62 | + $line += 1; |
|
63 | 63 | $column = $position + 1 - ($match[1] + mb_strlen($match[0])); |
64 | 64 | } |
65 | 65 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function enterNode(NodeInterface $node): ?NodeInterface |
21 | 21 | { |
22 | 22 | if ($node instanceof DocumentNode) { |
23 | - $this->operationCount = \count(array_filter($node->getDefinitions(), function ($definition) { |
|
23 | + $this->operationCount = \count(array_filter($node->getDefinitions(), function($definition) { |
|
24 | 24 | return $definition instanceof OperationDefinitionNode; |
25 | 25 | })); |
26 | 26 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public function getFragment(string $name): ?FragmentDefinitionNode |
144 | 144 | { |
145 | 145 | if (empty($this->fragments)) { |
146 | - $this->fragments = array_reduce($this->document->getDefinitions(), function ($fragments, $definition) { |
|
146 | + $this->fragments = array_reduce($this->document->getDefinitions(), function($fragments, $definition) { |
|
147 | 147 | if ($definition instanceof FragmentDefinitionNode) { |
148 | 148 | $fragments[$definition->getNameValue()] = $definition; |
149 | 149 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $usages = []; |
222 | 222 | $typeInfo = new TypeInfo($this->schema); |
223 | 223 | $visitor = new TypeInfoVisitor($typeInfo, new Visitor( |
224 | - function (NodeInterface $node) use (&$usages, $typeInfo): ?NodeInterface { |
|
224 | + function(NodeInterface $node) use (&$usages, $typeInfo): ?NodeInterface { |
|
225 | 225 | if ($node instanceof VariableDefinitionNode) { |
226 | 226 | return null; |
227 | 227 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | function arrayEvery(array $array, callable $fn): bool |
11 | 11 | { |
12 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
12 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
13 | 13 | return $result && $fn($value); |
14 | 14 | }, true); |
15 | 15 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function arraySome(array $array, callable $fn) |
23 | 23 | { |
24 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
24 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
25 | 25 | return $result || $fn($value); |
26 | 26 | }); |
27 | 27 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function keyMap(array $array, callable $keyFn): array |
51 | 51 | { |
52 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
52 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
53 | 53 | $map[$keyFn($item)] = $item; |
54 | 54 | return $map; |
55 | 55 | }, []); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function keyValMap(array $array, callable $keyFn, callable $valFn): array |
65 | 65 | { |
66 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
66 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
67 | 67 | $map[$keyFn($item)] = $valFn($item); |
68 | 68 | return $map; |
69 | 69 | }, []); |
@@ -16,8 +16,8 @@ |
||
16 | 16 | return false; |
17 | 17 | } |
18 | 18 | |
19 | - return arrayEvery($argumentsA, function (ArgumentNode $argumentA) use ($argumentsB) { |
|
20 | - $argumentB = find($argumentsB, function (ArgumentNode $argument) use ($argumentA) { |
|
19 | + return arrayEvery($argumentsA, function(ArgumentNode $argumentA) use ($argumentsB) { |
|
20 | + $argumentB = find($argumentsB, function(ArgumentNode $argument) use ($argumentA) { |
|
21 | 21 | return $argument->getNameValue() === $argumentA->getNameValue(); |
22 | 22 | }); |
23 | 23 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | |
107 | 107 | $suggestedInterfaceTypes = array_keys($interfaceUsageCount); |
108 | 108 | |
109 | - uasort($suggestedInterfaceTypes, function ($a, $b) use ($interfaceUsageCount) { |
|
109 | + uasort($suggestedInterfaceTypes, function($a, $b) use ($interfaceUsageCount) { |
|
110 | 110 | return $interfaceUsageCount[$b] - $interfaceUsageCount[$a]; |
111 | 111 | }); |
112 | 112 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** @var Directive $directiveDefinition */ |
49 | 49 | $directiveDefinition = find( |
50 | 50 | $this->validationContext->getSchema()->getDirectives(), |
51 | - function (Directive $definition) use ($node) { |
|
51 | + function(Directive $definition) use ($node) { |
|
52 | 52 | return $definition->getName() === $node->getNameValue(); |
53 | 53 | } |
54 | 54 | ); |