@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function getFieldsAsArray(): array |
35 | 35 | { |
36 | - return \array_map(function (SerializationInterface $node) { |
|
36 | + return \array_map(function(SerializationInterface $node) { |
|
37 | 37 | return $node->toArray(); |
38 | 38 | }, $this->fields); |
39 | 39 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getDirectivesAsArray(): array |
32 | 32 | { |
33 | - return \array_map(function (DirectiveNode $directive) { |
|
33 | + return \array_map(function(DirectiveNode $directive) { |
|
34 | 34 | return $directive->toArray(); |
35 | 35 | }, $this->directives); |
36 | 36 | } |
@@ -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 | ); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getDirective(string $name): ?Directive |
167 | 167 | { |
168 | - return find($this->directives, function (Directive $directive) use ($name) { |
|
168 | + return find($this->directives, function(Directive $directive) use ($name) { |
|
169 | 169 | return $directive->getName() === $name; |
170 | 170 | }); |
171 | 171 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | |
221 | 221 | $this->possibleTypesMap[$abstractTypeName] = \array_reduce( |
222 | 222 | $possibleTypes, |
223 | - function (array $map, TypeInterface $type) { |
|
223 | + function(array $map, TypeInterface $type) { |
|
224 | 224 | /** @var NameAwareInterface $type */ |
225 | 225 | $map[$type->getName()] = true; |
226 | 226 | return $map; |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
417 | 417 | foreach ($type->getFields() as $field) { |
418 | 418 | if ($field->hasArguments()) { |
419 | - $fieldArgTypes = \array_map(function (Argument $argument) { |
|
419 | + $fieldArgTypes = \array_map(function(Argument $argument) { |
|
420 | 420 | return $argument->getType(); |
421 | 421 | }, $field->getArguments()); |
422 | 422 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | return $map; |
451 | 451 | } |
452 | 452 | |
453 | - return \array_reduce($directive->getArguments(), function ($map, Argument $argument) { |
|
453 | + return \array_reduce($directive->getArguments(), function($map, Argument $argument) { |
|
454 | 454 | return $this->typeMapReducer($map, $argument->getType()); |
455 | 455 | }, $map); |
456 | 456 | } |
@@ -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 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | return $count === 1 |
37 | 37 | ? $selected[0] |
38 | - : \array_reduce($selected, function ($list, $item) use ($count, &$index) { |
|
38 | + : \array_reduce($selected, function($list, $item) use ($count, &$index) { |
|
39 | 39 | $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
40 | 40 | $item; |
41 | 41 | $index++; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $result = \array_keys($optionsByDistance); |
71 | 71 | |
72 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
72 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
73 | 73 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
74 | 74 | }); |
75 | 75 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function quotedOrList(array $items): string |
86 | 86 | { |
87 | - return orList(\array_map(function ($item) { |
|
87 | + return orList(\array_map(function($item) { |
|
88 | 88 | return '"' . $item . '"'; |
89 | 89 | }, $items)); |
90 | 90 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function arrayEvery(array $array, callable $fn): bool |
100 | 100 | { |
101 | - return \array_reduce($array, function ($result, $value) use ($fn) { |
|
101 | + return \array_reduce($array, function($result, $value) use ($fn) { |
|
102 | 102 | return $result && $fn($value); |
103 | 103 | }, true); |
104 | 104 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | function arraySome(array $array, callable $fn) |
112 | 112 | { |
113 | - return \array_reduce($array, function ($result, $value) use ($fn) { |
|
113 | + return \array_reduce($array, function($result, $value) use ($fn) { |
|
114 | 114 | return $result || $fn($value); |
115 | 115 | }); |
116 | 116 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | function keyMap(array $array, callable $keyFn): array |
140 | 140 | { |
141 | - return \array_reduce($array, function ($map, $item) use ($keyFn) { |
|
141 | + return \array_reduce($array, function($map, $item) use ($keyFn) { |
|
142 | 142 | $map[$keyFn($item)] = $item; |
143 | 143 | return $map; |
144 | 144 | }, []); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function keyValueMap(array $array, callable $keyFn, callable $valFn): array |
154 | 154 | { |
155 | - return \array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
155 | + return \array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
156 | 156 | $map[$keyFn($item)] = $valFn($item); |
157 | 157 | return $map; |
158 | 158 | }, []); |
@@ -370,7 +370,7 @@ |
||
370 | 370 | */ |
371 | 371 | protected function printMany(array $nodes): array |
372 | 372 | { |
373 | - return \array_map(function ($node) { |
|
373 | + return \array_map(function($node) { |
|
374 | 374 | return $this->print($node); |
375 | 375 | }, $nodes); |
376 | 376 | } |