@@ -19,8 +19,8 @@ |
||
19 | 19 | * @return mixed |
20 | 20 | */ |
21 | 21 | public function buildValueLiteral( |
22 | - LexerInterface $lexer, |
|
23 | - bool $isConst = false |
|
22 | + LexerInterface $lexer, |
|
23 | + bool $isConst = false |
|
24 | 24 | ): ?array; |
25 | 25 | |
26 | 26 | /** |
@@ -27,8 +27,8 @@ |
||
27 | 27 | * @param NodeBuilderInterface $nodeBuilder |
28 | 28 | */ |
29 | 29 | public function __construct( |
30 | - ASTBuilderInterface $astBuilder, |
|
31 | - NodeBuilderInterface $nodeBuilder |
|
30 | + ASTBuilderInterface $astBuilder, |
|
31 | + NodeBuilderInterface $nodeBuilder |
|
32 | 32 | ) { |
33 | 33 | $this->astBuilder = $astBuilder; |
34 | 34 | $this->nodeBuilder = $nodeBuilder; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @throws InvariantException |
42 | 42 | */ |
43 | 43 | public function __construct( |
44 | - string $body, |
|
44 | + string $body, |
|
45 | 45 | ?string $name = 'GraphQL request', |
46 | 46 | ?SourceLocation $locationOffset = null |
47 | 47 | ) { |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | ): Source { |
116 | 116 | if (null !== $locationOffset) { |
117 | 117 | invariant( |
118 | - $locationOffset->getLine() > 0, |
|
119 | - 'line is 1-indexed and must be positive' |
|
118 | + $locationOffset->getLine() > 0, |
|
119 | + 'line is 1-indexed and must be positive' |
|
120 | 120 | ); |
121 | 121 | |
122 | 122 | invariant( |
123 | - $locationOffset->getColumn() > 0, |
|
124 | - 'column is 1-indexed and must be positive' |
|
123 | + $locationOffset->getColumn() > 0, |
|
124 | + 'column is 1-indexed and must be positive' |
|
125 | 125 | ); |
126 | 126 | } |
127 | 127 |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $column = $position + 1; |
45 | 45 | $matches = []; |
46 | 46 | preg_match_all("/\r\n|[\n\r]/", |
47 | - mb_substr($source->getBody(), 0, $position), $matches, |
|
48 | - PREG_OFFSET_CAPTURE); |
|
47 | + mb_substr($source->getBody(), 0, $position), $matches, |
|
48 | + PREG_OFFSET_CAPTURE); |
|
49 | 49 | |
50 | 50 | foreach ($matches[0] as $index => $match) { |
51 | 51 | $line += 1; |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | public function toArray(): array |
78 | 78 | { |
79 | 79 | return [ |
80 | - 'line' => $this->line, |
|
81 | - 'column' => $this->column, |
|
80 | + 'line' => $this->line, |
|
81 | + 'column' => $this->column, |
|
82 | 82 | ]; |
83 | 83 | } |
84 | 84 | } |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | * @var array |
14 | 14 | */ |
15 | 15 | protected $provides = [ |
16 | - ASTBuilderInterface::class, |
|
17 | - NodeBuilderInterface::class, |
|
18 | - LexerInterface::class, |
|
19 | - ParserInterface::class, |
|
20 | - PrinterInterface::class, |
|
16 | + ASTBuilderInterface::class, |
|
17 | + NodeBuilderInterface::class, |
|
18 | + LexerInterface::class, |
|
19 | + ParserInterface::class, |
|
20 | + PrinterInterface::class, |
|
21 | 21 | ]; |
22 | 22 | |
23 | 23 | /** |
@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | public function register() |
27 | 27 | { |
28 | 28 | $this->container->add(ASTBuilderInterface::class, ASTBuilder::class, |
29 | - true/* $shared */); |
|
29 | + true/* $shared */); |
|
30 | 30 | $this->container->add(NodeBuilderInterface::class, NodeBuilder::class, |
31 | - true/* $shared */); |
|
31 | + true/* $shared */); |
|
32 | 32 | |
33 | 33 | $this->container->add(ParserInterface::class, Parser::class, |
34 | - true/* $shared */) |
|
35 | - ->withArgument(ASTBuilderInterface::class) |
|
36 | - ->withArgument(NodeBuilderInterface::class); |
|
34 | + true/* $shared */) |
|
35 | + ->withArgument(ASTBuilderInterface::class) |
|
36 | + ->withArgument(NodeBuilderInterface::class); |
|
37 | 37 | |
38 | 38 | $this->container->add(LexerInterface::class, function () { |
39 | 39 | return new Lexer(SupportedReaders::get()); |
40 | 40 | }); |
41 | 41 | |
42 | 42 | $this->container->add(PrinterInterface::class, Printer::class, |
43 | - true/* $shared */) |
|
44 | - ->withArgument(SupportedWriters::get()); |
|
43 | + true/* $shared */) |
|
44 | + ->withArgument(SupportedWriters::get()); |
|
45 | 45 | } |
46 | 46 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | ->withArgument(ASTBuilderInterface::class) |
36 | 36 | ->withArgument(NodeBuilderInterface::class); |
37 | 37 | |
38 | - $this->container->add(LexerInterface::class, function () { |
|
38 | + $this->container->add(LexerInterface::class, function() { |
|
39 | 39 | return new Lexer(SupportedReaders::get()); |
40 | 40 | }); |
41 | 41 |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @return NodeInterface|null |
390 | 390 | */ |
391 | 391 | protected function enterInputObjectTypeDefinition( |
392 | - InputObjectTypeDefinitionNode $node |
|
392 | + InputObjectTypeDefinitionNode $node |
|
393 | 393 | ): ?NodeInterface |
394 | 394 | { |
395 | 395 | return $node; |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * @return NodeInterface|null |
402 | 402 | */ |
403 | 403 | protected function leaveInputObjectTypeDefinition( |
404 | - InputObjectTypeDefinitionNode $node |
|
404 | + InputObjectTypeDefinitionNode $node |
|
405 | 405 | ): ?NodeInterface |
406 | 406 | { |
407 | 407 | return $node; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * @return NodeInterface|null |
414 | 414 | */ |
415 | 415 | protected function enterInputObjectTypeExtension( |
416 | - InputObjectTypeExtensionNode $node |
|
416 | + InputObjectTypeExtensionNode $node |
|
417 | 417 | ): ?NodeInterface |
418 | 418 | { |
419 | 419 | return $node; |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | * @return NodeInterface|null |
426 | 426 | */ |
427 | 427 | protected function leaveInputObjectTypeExtension( |
428 | - InputObjectTypeExtensionNode $node |
|
428 | + InputObjectTypeExtensionNode $node |
|
429 | 429 | ): ?NodeInterface |
430 | 430 | { |
431 | 431 | return $node; |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * @return NodeInterface|null |
480 | 480 | */ |
481 | 481 | protected function enterInterfaceTypeDefinition( |
482 | - InterfaceTypeDefinitionNode $node |
|
482 | + InterfaceTypeDefinitionNode $node |
|
483 | 483 | ): ?NodeInterface |
484 | 484 | { |
485 | 485 | return $node; |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | * @return NodeInterface|null |
492 | 492 | */ |
493 | 493 | protected function leaveInterfaceTypeDefinition( |
494 | - InterfaceTypeDefinitionNode $node |
|
494 | + InterfaceTypeDefinitionNode $node |
|
495 | 495 | ): ?NodeInterface |
496 | 496 | { |
497 | 497 | return $node; |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * @return NodeInterface|null |
504 | 504 | */ |
505 | 505 | protected function enterInterfaceTypeExtension( |
506 | - InterfaceTypeExtensionNode $node |
|
506 | + InterfaceTypeExtensionNode $node |
|
507 | 507 | ): ?NodeInterface |
508 | 508 | { |
509 | 509 | return $node; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | * @return NodeInterface|null |
516 | 516 | */ |
517 | 517 | protected function leaveInterfaceTypeExtension( |
518 | - InterfaceTypeExtensionNode $node |
|
518 | + InterfaceTypeExtensionNode $node |
|
519 | 519 | ): ?NodeInterface |
520 | 520 | { |
521 | 521 | return $node; |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | * @return NodeInterface|null |
754 | 754 | */ |
755 | 755 | protected function enterOperationTypeDefinition( |
756 | - OperationTypeDefinitionNode $node |
|
756 | + OperationTypeDefinitionNode $node |
|
757 | 757 | ): ?NodeInterface |
758 | 758 | { |
759 | 759 | return $node; |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | * @return NodeInterface|null |
766 | 766 | */ |
767 | 767 | protected function leaveOperationTypeDefinition( |
768 | - OperationTypeDefinitionNode $node |
|
768 | + OperationTypeDefinitionNode $node |
|
769 | 769 | ): ?NodeInterface |
770 | 770 | { |
771 | 771 | return $node; |
@@ -17,11 +17,11 @@ |
||
17 | 17 | * @return NodeInterface|null |
18 | 18 | */ |
19 | 19 | public function acceptVisitor( |
20 | - VisitorInterface $visitor, |
|
21 | - $key = null, |
|
20 | + VisitorInterface $visitor, |
|
21 | + $key = null, |
|
22 | 22 | ?NodeInterface $parent = null, |
23 | - array $path = [], |
|
24 | - array $ancestors = [] |
|
23 | + array $path = [], |
|
24 | + array $ancestors = [] |
|
25 | 25 | ): ?NodeInterface; |
26 | 26 | |
27 | 27 | /** |
@@ -12,102 +12,102 @@ discard block |
||
12 | 12 | * @var array |
13 | 13 | */ |
14 | 14 | protected static $kindToNodesToVisitMap = [ |
15 | - 'Name' => [], |
|
15 | + 'Name' => [], |
|
16 | 16 | |
17 | - 'Document' => ['definitions'], |
|
18 | - 'OperationDefinition' => [ |
|
17 | + 'Document' => ['definitions'], |
|
18 | + 'OperationDefinition' => [ |
|
19 | 19 | 'name', |
20 | 20 | 'variableDefinitions', |
21 | 21 | 'directives', |
22 | 22 | 'selectionSet', |
23 | - ], |
|
24 | - 'VariableDefinition' => ['variable', 'type', 'defaultValue'], |
|
25 | - 'Variable' => ['name'], |
|
26 | - 'SelectionSet' => ['selections'], |
|
27 | - 'Field' => ['alias', 'name', 'arguments', 'directives', 'selectionSet'], |
|
28 | - 'Argument' => ['name', 'value'], |
|
29 | - |
|
30 | - 'FragmentSpread' => ['name', 'directives'], |
|
31 | - 'InlineFragment' => ['typeCondition', 'directives', 'selectionSet'], |
|
32 | - 'FragmentDefinition' => [ |
|
23 | + ], |
|
24 | + 'VariableDefinition' => ['variable', 'type', 'defaultValue'], |
|
25 | + 'Variable' => ['name'], |
|
26 | + 'SelectionSet' => ['selections'], |
|
27 | + 'Field' => ['alias', 'name', 'arguments', 'directives', 'selectionSet'], |
|
28 | + 'Argument' => ['name', 'value'], |
|
29 | + |
|
30 | + 'FragmentSpread' => ['name', 'directives'], |
|
31 | + 'InlineFragment' => ['typeCondition', 'directives', 'selectionSet'], |
|
32 | + 'FragmentDefinition' => [ |
|
33 | 33 | 'name', |
34 | - // Note: fragment variable definitions are experimental and may be changed or removed in the future. |
|
34 | + // Note: fragment variable definitions are experimental and may be changed or removed in the future. |
|
35 | 35 | 'variableDefinitions', |
36 | 36 | 'typeCondition', |
37 | 37 | 'directives', |
38 | 38 | 'selectionSet', |
39 | - ], |
|
39 | + ], |
|
40 | 40 | |
41 | - 'IntValue' => [], |
|
42 | - 'FloatValue' => [], |
|
43 | - 'StringValue' => [], |
|
44 | - 'BooleanValue' => [], |
|
45 | - 'NullValue' => [], |
|
46 | - 'EnumValue' => [], |
|
47 | - 'ListValue' => ['values'], |
|
48 | - 'ObjectValue' => ['fields'], |
|
49 | - 'ObjectField' => ['name', 'value'], |
|
41 | + 'IntValue' => [], |
|
42 | + 'FloatValue' => [], |
|
43 | + 'StringValue' => [], |
|
44 | + 'BooleanValue' => [], |
|
45 | + 'NullValue' => [], |
|
46 | + 'EnumValue' => [], |
|
47 | + 'ListValue' => ['values'], |
|
48 | + 'ObjectValue' => ['fields'], |
|
49 | + 'ObjectField' => ['name', 'value'], |
|
50 | 50 | |
51 | - 'Directive' => ['name', 'arguments'], |
|
51 | + 'Directive' => ['name', 'arguments'], |
|
52 | 52 | |
53 | - 'NamedType' => ['name'], |
|
54 | - 'ListType' => ['type'], |
|
55 | - 'NonNullType' => ['type'], |
|
53 | + 'NamedType' => ['name'], |
|
54 | + 'ListType' => ['type'], |
|
55 | + 'NonNullType' => ['type'], |
|
56 | 56 | |
57 | - 'SchemaDefinition' => ['directives', 'operationTypes'], |
|
58 | - 'OperationTypeDefinition' => ['type'], |
|
57 | + 'SchemaDefinition' => ['directives', 'operationTypes'], |
|
58 | + 'OperationTypeDefinition' => ['type'], |
|
59 | 59 | |
60 | - 'ScalarTypeDefinition' => ['description', 'name', 'directives'], |
|
61 | - 'ObjectTypeDefinition' => [ |
|
60 | + 'ScalarTypeDefinition' => ['description', 'name', 'directives'], |
|
61 | + 'ObjectTypeDefinition' => [ |
|
62 | 62 | 'description', |
63 | 63 | 'name', |
64 | 64 | 'interfaces', |
65 | 65 | 'directives', |
66 | 66 | 'fields', |
67 | - ], |
|
68 | - 'FieldDefinition' => [ |
|
67 | + ], |
|
68 | + 'FieldDefinition' => [ |
|
69 | 69 | 'description', |
70 | 70 | 'name', |
71 | 71 | 'arguments', |
72 | 72 | 'type', |
73 | 73 | 'directives', |
74 | - ], |
|
75 | - 'InputValueDefinition' => [ |
|
74 | + ], |
|
75 | + 'InputValueDefinition' => [ |
|
76 | 76 | 'description', |
77 | 77 | 'name', |
78 | 78 | 'type', |
79 | 79 | 'defaultValue', |
80 | 80 | 'directives', |
81 | - ], |
|
82 | - 'InterfaceTypeDefinition' => [ |
|
81 | + ], |
|
82 | + 'InterfaceTypeDefinition' => [ |
|
83 | 83 | 'description', |
84 | 84 | 'name', |
85 | 85 | 'directives', |
86 | 86 | 'fields', |
87 | - ], |
|
88 | - 'UnionTypeDefinition' => ['description', 'name', 'directives', 'types'], |
|
89 | - 'EnumTypeDefinition' => ['description', 'name', 'directives', 'values'], |
|
90 | - 'EnumValueDefinition' => ['description', 'name', 'directives'], |
|
91 | - 'InputObjectTypeDefinition' => [ |
|
87 | + ], |
|
88 | + 'UnionTypeDefinition' => ['description', 'name', 'directives', 'types'], |
|
89 | + 'EnumTypeDefinition' => ['description', 'name', 'directives', 'values'], |
|
90 | + 'EnumValueDefinition' => ['description', 'name', 'directives'], |
|
91 | + 'InputObjectTypeDefinition' => [ |
|
92 | 92 | 'description', |
93 | 93 | 'name', |
94 | 94 | 'directives', |
95 | 95 | 'fields', |
96 | - ], |
|
96 | + ], |
|
97 | 97 | |
98 | - 'ScalarTypeExtension' => ['name', 'directives'], |
|
99 | - 'ObjectTypeExtension' => ['name', 'interfaces', 'directives', 'fields'], |
|
100 | - 'InterfaceTypeExtension' => ['name', 'directives', 'fields'], |
|
101 | - 'UnionTypeExtension' => ['name', 'directives', 'types'], |
|
102 | - 'EnumTypeExtension' => ['name', 'directives', 'values'], |
|
103 | - 'InputObjectTypeExtension' => ['name', 'directives', 'fields'], |
|
98 | + 'ScalarTypeExtension' => ['name', 'directives'], |
|
99 | + 'ObjectTypeExtension' => ['name', 'interfaces', 'directives', 'fields'], |
|
100 | + 'InterfaceTypeExtension' => ['name', 'directives', 'fields'], |
|
101 | + 'UnionTypeExtension' => ['name', 'directives', 'types'], |
|
102 | + 'EnumTypeExtension' => ['name', 'directives', 'values'], |
|
103 | + 'InputObjectTypeExtension' => ['name', 'directives', 'fields'], |
|
104 | 104 | |
105 | - 'DirectiveDefinition' => [ |
|
105 | + 'DirectiveDefinition' => [ |
|
106 | 106 | 'description', |
107 | 107 | 'name', |
108 | 108 | 'arguments', |
109 | 109 | 'locations', |
110 | - ], |
|
110 | + ], |
|
111 | 111 | ]; |
112 | 112 | |
113 | 113 | /** |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | * @return NodeInterface|AcceptsVisitorsTrait|SerializationInterface|null |
151 | 151 | */ |
152 | 152 | public function acceptVisitor( |
153 | - VisitorInterface $visitor, |
|
154 | - $key = null, |
|
153 | + VisitorInterface $visitor, |
|
154 | + $key = null, |
|
155 | 155 | ?NodeInterface $parent = null, |
156 | - array $path = [], |
|
157 | - array $ancestors = [] |
|
156 | + array $path = [], |
|
157 | + array $ancestors = [] |
|
158 | 158 | ): ?NodeInterface |
159 | 159 | { |
160 | 160 | $this->visitor = $visitor; |
@@ -307,21 +307,21 @@ discard block |
||
307 | 307 | * @return NodeInterface|null |
308 | 308 | */ |
309 | 309 | protected function visitNode( |
310 | - NodeInterface $node, |
|
311 | - $key, |
|
310 | + NodeInterface $node, |
|
311 | + $key, |
|
312 | 312 | ?NodeInterface $parent |
313 | 313 | ): ?NodeInterface |
314 | 314 | { |
315 | 315 | $this->addOneToPath($key); |
316 | 316 | |
317 | 317 | $newNode = $node->acceptVisitor($this->visitor, $key, $parent, |
318 | - $this->path, $this->ancestors); |
|
318 | + $this->path, $this->ancestors); |
|
319 | 319 | |
320 | 320 | // If the node was edited, we need to revisit it |
321 | 321 | // to produce the expected result. |
322 | 322 | if (null !== $newNode && $newNode->isEdited()) { |
323 | 323 | $newNode = $newNode->acceptVisitor($this->visitor, $key, $parent, |
324 | - $this->path, $this->ancestors); |
|
324 | + $this->path, $this->ancestors); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | $this->removeOneFromPath(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $fieldType = null; |
71 | 71 | if (null !== $parentType) { |
72 | 72 | $fieldDefinition = $this->typeInfo->resolveFieldDefinition($schema, |
73 | - $parentType, $node); |
|
73 | + $parentType, $node); |
|
74 | 74 | if (null !== $fieldDefinition) { |
75 | 75 | $fieldType = $fieldDefinition->getType(); |
76 | 76 | } |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | $fieldOrDirective = $this->typeInfo->getDirective() ?: $this->typeInfo->getFieldDefinition(); |
107 | 107 | if (null !== $fieldOrDirective) { |
108 | 108 | $argumentDefinition = find( |
109 | - $fieldOrDirective->getArguments(), |
|
110 | - function (Argument $argument) use ($node) { |
|
111 | - return $argument->getName() === $node->getNameValue(); |
|
112 | - } |
|
109 | + $fieldOrDirective->getArguments(), |
|
110 | + function (Argument $argument) use ($node) { |
|
111 | + return $argument->getName() === $node->getNameValue(); |
|
112 | + } |
|
113 | 113 | ); |
114 | 114 | if (null !== $argumentDefinition) { |
115 | 115 | $argumentType = $argumentDefinition->getType(); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | if (null !== $fieldOrDirective) { |
108 | 108 | $argumentDefinition = find( |
109 | 109 | $fieldOrDirective->getArguments(), |
110 | - function (Argument $argument) use ($node) { |
|
110 | + function(Argument $argument) use ($node) { |
|
111 | 111 | return $argument->getName() === $node->getNameValue(); |
112 | 112 | } |
113 | 113 | ); |