@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function buildTypes(): array |
79 | 79 | { |
80 | - return \array_map(function (TypeDefinitionNodeInterface $definition) { |
|
80 | + return \array_map(function(TypeDefinitionNodeInterface $definition) { |
|
81 | 81 | return $this->definitionBuilder->buildType($definition); |
82 | 82 | }, \array_values($this->info->getTypeDefinitionMap())); |
83 | 83 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function buildDirectives(): array |
89 | 89 | { |
90 | - $directives = \array_map(function (DirectiveDefinitionNode $definition) { |
|
90 | + $directives = \array_map(function(DirectiveDefinitionNode $definition) { |
|
91 | 91 | return $this->definitionBuilder->buildDirective($definition); |
92 | 92 | }, $this->info->getDirectiveDefinitions()); |
93 | 93 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ]; |
99 | 99 | |
100 | 100 | foreach ($specifiedDirectivesMap as $name => $directive) { |
101 | - if (!arraySome($directives, function (Directive $directive) use ($name) { |
|
101 | + if (!arraySome($directives, function(Directive $directive) use ($name) { |
|
102 | 102 | return $directive->getName() === $name; |
103 | 103 | })) { |
104 | 104 | $directives[] = $directive; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $coercedValues; |
57 | 57 | } |
58 | 58 | |
59 | - $argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) { |
|
59 | + $argumentNodeMap = keyMap($argumentNodes, function(ArgumentNode $value) { |
|
60 | 60 | return $value->getNameValue(); |
61 | 61 | }); |
62 | 62 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | array $variableValues = [] |
132 | 132 | ): ?array { |
133 | 133 | $directiveNode = $node->hasDirectives() |
134 | - ? find($node->getDirectives(), function (NameAwareInterface $value) use ($directive) { |
|
134 | + ? find($node->getDirectives(), function(NameAwareInterface $value) use ($directive) { |
|
135 | 135 | return $value->getNameValue() === $directive->getName(); |
136 | 136 | }) : null; |
137 | 137 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | ]); |
330 | 330 | } |
331 | 331 | return new CoercedValue($parseResult, null); |
332 | - } catch (InvalidTypeException|CoercingException $ex) { |
|
332 | + } catch (InvalidTypeException | CoercingException $ex) { |
|
333 | 333 | return new CoercedValue(null, [ |
334 | 334 | $this->buildCoerceException( |
335 | 335 | sprintf('Expected type %s', (string)$type), |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
366 | - $suggestions = suggestionList((string)$value, array_map(function (EnumValue $enumValue) { |
|
366 | + $suggestions = suggestionList((string)$value, array_map(function(EnumValue $enumValue) { |
|
367 | 367 | return $enumValue->getName(); |
368 | 368 | }, $type->getValues())); |
369 | 369 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function getTypeResolver(): ?callable |
27 | 27 | { |
28 | - return function ($rootValue, $contextValues, ResolveInfo $info) { |
|
28 | + return function($rootValue, $contextValues, ResolveInfo $info) { |
|
29 | 29 | return $this->resolveType($rootValue, $contextValues, $info); |
30 | 30 | }; |
31 | 31 | } |
@@ -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 |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | /** |
322 | 322 | * @return TypeNodeInterface |
323 | 323 | */ |
324 | - $parseType = function (): TypeNodeInterface { |
|
324 | + $parseType = function(): TypeNodeInterface { |
|
325 | 325 | $this->expect(TokenKindEnum::COLON); |
326 | 326 | return $this->parseTypeReference(); |
327 | 327 | }; |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | /** |
433 | 433 | * @return ArgumentNode |
434 | 434 | */ |
435 | - $parseFunction = function () use ($isConst): ArgumentNode { |
|
435 | + $parseFunction = function() use ($isConst) : ArgumentNode { |
|
436 | 436 | return $this->parseArgument($isConst); |
437 | 437 | }; |
438 | 438 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | /** |
460 | 460 | * @return NodeInterface|TypeNodeInterface|ValueNodeInterface |
461 | 461 | */ |
462 | - $parseValue = function () use ($isConst): NodeInterface { |
|
462 | + $parseValue = function() use ($isConst): NodeInterface { |
|
463 | 463 | $this->expect(TokenKindEnum::COLON); |
464 | 464 | return $this->parseValueLiteral($isConst); |
465 | 465 | }; |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | |
529 | 529 | $this->expectKeyword(KeywordEnum::FRAGMENT); |
530 | 530 | |
531 | - $parseTypeCondition = function () { |
|
531 | + $parseTypeCondition = function() { |
|
532 | 532 | $this->expectKeyword(KeywordEnum::ON); |
533 | 533 | return $this->parseNamedType(); |
534 | 534 | }; |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | { |
658 | 658 | $start = $this->lexer->getToken(); |
659 | 659 | |
660 | - $parseFunction = function () use ($isConst) { |
|
660 | + $parseFunction = function() use ($isConst) { |
|
661 | 661 | return $this->parseValueLiteral($isConst); |
662 | 662 | }; |
663 | 663 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | * @param bool $isConst |
711 | 711 | * @return NodeInterface|TypeNodeInterface|ValueNodeInterface |
712 | 712 | */ |
713 | - $parseValue = function (bool $isConst): NodeInterface { |
|
713 | + $parseValue = function(bool $isConst): NodeInterface { |
|
714 | 714 | $this->expect(TokenKindEnum::COLON); |
715 | 715 | return $this->parseValueLiteral($isConst); |
716 | 716 | }; |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | */ |
1054 | 1054 | protected function parseArgumentsDefinition(): array |
1055 | 1055 | { |
1056 | - $parseFunction = function (): InputValueDefinitionNode { |
|
1056 | + $parseFunction = function(): InputValueDefinitionNode { |
|
1057 | 1057 | return $this->parseInputValueDefinition(); |
1058 | 1058 | }; |
1059 | 1059 | |
@@ -1259,7 +1259,7 @@ discard block |
||
1259 | 1259 | */ |
1260 | 1260 | protected function parseInputFieldsDefinition(): array |
1261 | 1261 | { |
1262 | - $parseFunction = function (): InputValueDefinitionNode { |
|
1262 | + $parseFunction = function(): InputValueDefinitionNode { |
|
1263 | 1263 | return $this->parseInputValueDefinition(); |
1264 | 1264 | }; |
1265 | 1265 | |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | |
1564 | 1564 | $name = $this->parseName(); |
1565 | 1565 | |
1566 | - if (arraySome(DirectiveLocationEnum::values(), function ($value) use ($name) { |
|
1566 | + if (arraySome(DirectiveLocationEnum::values(), function($value) use ($name) { |
|
1567 | 1567 | return $name->getValue() === $value; |
1568 | 1568 | })) { |
1569 | 1569 | return $name; |
@@ -578,7 +578,7 @@ |
||
578 | 578 | if ($this->isEscapedTripleQuote($code)) { |
579 | 579 | $rawValue .= sliceString($this->body, $chunkStart, $this->position) . '"""'; |
580 | 580 | $this->position += 4; |
581 | - $chunkStart = $this->position; |
|
581 | + $chunkStart = $this->position; |
|
582 | 582 | } else { |
583 | 583 | ++$this->position; |
584 | 584 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | { |
51 | 51 | return arraySome( |
52 | 52 | specifiedDirectives(), |
53 | - function (Directive $specifiedDirective) use ($directive) { |
|
53 | + function(Directive $specifiedDirective) use ($directive) { |
|
54 | 54 | return $specifiedDirective->getName() === $directive->getName(); |
55 | 55 | } |
56 | 56 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function getExtendedTypes(): array |
114 | 114 | { |
115 | - $extendedTypes = \array_map(function ($type) { |
|
115 | + $extendedTypes = \array_map(function($type) { |
|
116 | 116 | return $this->getExtendedType($type); |
117 | 117 | }, $this->info->getSchema()->getTypeMap()); |
118 | 118 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | return \array_merge( |
136 | 136 | $existingDirectives, |
137 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
137 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
138 | 138 | return $this->definitionBuilder->buildDirective($node); |
139 | 139 | }, $this->info->getDirectiveDefinitions()) |
140 | 140 | ); |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | return newObjectType([ |
241 | 241 | 'name' => $typeName, |
242 | 242 | 'description' => $type->getDescription(), |
243 | - 'interfaces' => function () use ($type) { |
|
243 | + 'interfaces' => function() use ($type) { |
|
244 | 244 | return $this->extendImplementedInterfaces($type); |
245 | 245 | }, |
246 | - 'fields' => function () use ($type) { |
|
246 | + 'fields' => function() use ($type) { |
|
247 | 247 | return $this->extendFieldMap($type); |
248 | 248 | }, |
249 | 249 | 'astNode' => $type->getAstNode(), |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | return newInterfaceType([ |
270 | 270 | 'name' => $typeName, |
271 | 271 | 'description' => $type->getDescription(), |
272 | - 'fields' => function () use ($type) { |
|
272 | + 'fields' => function() use ($type) { |
|
273 | 273 | return $this->extendFieldMap($type); |
274 | 274 | }, |
275 | 275 | 'astNode' => $type->getAstNode(), |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | return newUnionType([ |
300 | 300 | 'name' => $type->getName(), |
301 | 301 | 'description' => $type->getDescription(), |
302 | - 'types' => \array_map(function ($unionType) { |
|
302 | + 'types' => \array_map(function($unionType) { |
|
303 | 303 | return $this->getExtendedType($unionType); |
304 | 304 | }, $type->getTypes()), |
305 | 305 | 'astNode' => $type->getAstNode(), |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | { |
317 | 317 | $typeName = $type->getName(); |
318 | 318 | |
319 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
319 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
320 | 320 | return $this->getExtendedType($interface); |
321 | 321 | }, $type->getInterfaces()); |
322 | 322 |