@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function getLocationsAsArray(): ?array |
154 | 154 | { |
155 | - return !empty($this->locations) ? \array_map(function (SourceLocation $location) { |
|
155 | + return !empty($this->locations) ? \array_map(function(SourceLocation $location) { |
|
156 | 156 | return $location->toArray(); |
157 | 157 | }, $this->locations) : null; |
158 | 158 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | ? (!empty($nodes) ? $nodes : []) |
192 | 192 | : (null !== $nodes ? [$nodes] : []); |
193 | 193 | |
194 | - $this->nodes = \array_filter($nodes, function ($node) { |
|
194 | + $this->nodes = \array_filter($nodes, function($node) { |
|
195 | 195 | return null !== $node; |
196 | 196 | }); |
197 | 197 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | protected function resolvePositions(?array $positions) |
223 | 223 | { |
224 | 224 | if (null === $positions && !empty($this->nodes)) { |
225 | - $positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) { |
|
225 | + $positions = \array_reduce($this->nodes, function(array $list, ?NodeInterface $node) { |
|
226 | 226 | if (null !== $node) { |
227 | 227 | $location = $node->getLocation(); |
228 | 228 | if (null !== $location) { |
@@ -250,11 +250,11 @@ discard block |
||
250 | 250 | protected function resolveLocations(?array $positions, ?Source $source) |
251 | 251 | { |
252 | 252 | if (null !== $positions && null !== $source) { |
253 | - $locations = \array_map(function ($position) use ($source) { |
|
253 | + $locations = \array_map(function($position) use ($source) { |
|
254 | 254 | return SourceLocation::fromSource($source, $position); |
255 | 255 | }, $positions); |
256 | 256 | } elseif (!empty($this->nodes)) { |
257 | - $locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
257 | + $locations = \array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
258 | 258 | $location = $node->getLocation(); |
259 | 259 | if (null !== $location) { |
260 | 260 | $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart()); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | \preg_match_all("/\r\n|[\n\r]/", \substr($source->getBody(), 0, $position), $matches, PREG_OFFSET_CAPTURE); |
62 | 62 | |
63 | 63 | foreach ($matches[0] as $index => $match) { |
64 | - $line += 1; |
|
64 | + $line += 1; |
|
65 | 65 | $column = $position + 1 - ($match[1] + \strlen($match[0])); |
66 | 66 | } |
67 | 67 |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function parseArguments(LexerInterface $lexer, bool $isConst = false): ?array |
170 | 170 | { |
171 | - $parseFunction = function (LexerInterface $lexer) use ($isConst): ArgumentNode { |
|
171 | + $parseFunction = function(LexerInterface $lexer) use ($isConst) : ArgumentNode { |
|
172 | 172 | return $this->parseArgument($lexer, $isConst); |
173 | 173 | }; |
174 | 174 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @param LexerInterface $lexer |
197 | 197 | * @return NodeInterface|TypeNodeInterface|ValueNodeInterface |
198 | 198 | */ |
199 | - $parseValue = function (LexerInterface $lexer) use ($isConst): NodeInterface { |
|
199 | + $parseValue = function(LexerInterface $lexer) use ($isConst): NodeInterface { |
|
200 | 200 | $this->expect($lexer, TokenKindEnum::COLON); |
201 | 201 | return $this->parseValueLiteral($lexer, $isConst); |
202 | 202 | }; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | protected function parseArgumentsDefinition(LexerInterface $lexer): array |
217 | 217 | { |
218 | - $parseFunction = function (LexerInterface $lexer): InputValueDefinitionNode { |
|
218 | + $parseFunction = function(LexerInterface $lexer): InputValueDefinitionNode { |
|
219 | 219 | return $this->parseInputValueDefinition($lexer); |
220 | 220 | }; |
221 | 221 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | $name = $this->parseName($lexer); |
304 | 304 | |
305 | - if (arraySome(DirectiveLocationEnum::values(), function ($value) use ($name) { |
|
305 | + if (arraySome(DirectiveLocationEnum::values(), function($value) use ($name) { |
|
306 | 306 | return $name->getValue() === $value; |
307 | 307 | })) { |
308 | 308 | return $name; |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | |
677 | 677 | $this->expectKeyword($lexer, KeywordEnum::FRAGMENT); |
678 | 678 | |
679 | - $parseTypeCondition = function (LexerInterface $lexer) { |
|
679 | + $parseTypeCondition = function(LexerInterface $lexer) { |
|
680 | 680 | $this->expectKeyword($lexer, 'on'); |
681 | 681 | return $this->parseNamedType($lexer); |
682 | 682 | }; |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | */ |
736 | 736 | protected function parseInputFieldsDefinition(LexerInterface $lexer): array |
737 | 737 | { |
738 | - $parseFunction = function (LexerInterface $lexer): InputValueDefinitionNode { |
|
738 | + $parseFunction = function(LexerInterface $lexer): InputValueDefinitionNode { |
|
739 | 739 | return $this->parseInputValueDefinition($lexer); |
740 | 740 | }; |
741 | 741 | |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | { |
1297 | 1297 | $start = $lexer->getToken(); |
1298 | 1298 | |
1299 | - $parseFunction = function (LexerInterface $lexer) use ($isConst) { |
|
1299 | + $parseFunction = function(LexerInterface $lexer) use ($isConst) { |
|
1300 | 1300 | return $this->parseValueLiteral($lexer, $isConst); |
1301 | 1301 | }; |
1302 | 1302 | |
@@ -1345,7 +1345,7 @@ discard block |
||
1345 | 1345 | { |
1346 | 1346 | $start = $lexer->getToken(); |
1347 | 1347 | |
1348 | - $parseValue = function (LexerInterface $lexer, bool $isConst) { |
|
1348 | + $parseValue = function(LexerInterface $lexer, bool $isConst) { |
|
1349 | 1349 | $this->expect($lexer, TokenKindEnum::COLON); |
1350 | 1350 | |
1351 | 1351 | return $this->parseValueLiteral($lexer, $isConst); |
@@ -1405,7 +1405,7 @@ discard block |
||
1405 | 1405 | * @param LexerInterface $lexer |
1406 | 1406 | * @return mixed |
1407 | 1407 | */ |
1408 | - $parseType = function (LexerInterface $lexer): TypeNodeInterface { |
|
1408 | + $parseType = function(LexerInterface $lexer): TypeNodeInterface { |
|
1409 | 1409 | $this->expect($lexer, TokenKindEnum::COLON); |
1410 | 1410 | |
1411 | 1411 | return $this->parseTypeReference($lexer); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getValuesAsArray(): array |
40 | 40 | { |
41 | - return \array_map(function (SerializationInterface $node) { |
|
41 | + return \array_map(function(SerializationInterface $node) { |
|
42 | 42 | return $node->toArray(); |
43 | 43 | }, $this->values); |
44 | 44 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function __toString(): string |
72 | 72 | { |
73 | - return \json_encode(\array_map(function (ValueNodeInterface $node) { |
|
73 | + return \json_encode(\array_map(function(ValueNodeInterface $node) { |
|
74 | 74 | return $node->getValue(); |
75 | 75 | }, $this->getValues())); |
76 | 76 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function getArgumentsAsArray(): array |
34 | 34 | { |
35 | - return \array_map(function (SerializationInterface $node) { |
|
35 | + return \array_map(function(SerializationInterface $node) { |
|
36 | 36 | return $node->toArray(); |
37 | 37 | }, $this->getArguments()); |
38 | 38 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function getDefinitionsAsArray(): array |
40 | 40 | { |
41 | - return \array_map(function (SerializationInterface $node) { |
|
41 | + return \array_map(function(SerializationInterface $node) { |
|
42 | 42 | return $node->toArray(); |
43 | 43 | }, $this->definitions); |
44 | 44 | } |