@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $context = $this->createContext($schema, $document, $typeInfo); |
48 | 48 | |
49 | - $visitors = \array_map(function (RuleInterface $rule) use ($context) { |
|
49 | + $visitors = \array_map(function(RuleInterface $rule) use ($context) { |
|
50 | 50 | return $rule->setContext($context); |
51 | 51 | }, $rules); |
52 | 52 |
@@ -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; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $builtInTypes = keyMap( |
98 | 98 | \array_merge(specifiedScalarTypes(), introspectionTypes()), |
99 | - function (NamedTypeInterface $type) { |
|
99 | + function(NamedTypeInterface $type) { |
|
100 | 100 | return $type->getName(); |
101 | 101 | } |
102 | 102 | ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function buildTypes(array $nodes): array |
113 | 113 | { |
114 | - return \array_map(function (NodeInterface $node) { |
|
114 | + return \array_map(function(NodeInterface $node) { |
|
115 | 115 | return $this->buildType($node); |
116 | 116 | }, $nodes); |
117 | 117 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | return newDirective([ |
148 | 148 | 'name' => $node->getNameValue(), |
149 | 149 | 'description' => $node->getDescriptionValue(), |
150 | - 'locations' => \array_map(function (NameNode $node) { |
|
150 | + 'locations' => \array_map(function(NameNode $node) { |
|
151 | 151 | return $node->getValue(); |
152 | 152 | }, $node->getLocations()), |
153 | 153 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | { |
192 | 192 | return keyValueMap( |
193 | 193 | $nodes, |
194 | - function (InputValueDefinitionNode $value) { |
|
194 | + function(InputValueDefinitionNode $value) { |
|
195 | 195 | return $value->getNameValue(); |
196 | 196 | }, |
197 | - function (InputValueDefinitionNode $value): array { |
|
197 | + function(InputValueDefinitionNode $value): array { |
|
198 | 198 | $type = $this->buildWrappedType($value->getType()); |
199 | 199 | $defaultValue = $value->getDefaultValue(); |
200 | 200 | return [ |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | return newObjectType([ |
247 | 247 | 'name' => $node->getNameValue(), |
248 | 248 | 'description' => $node->getDescriptionValue(), |
249 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
249 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
250 | 250 | return $this->buildFields($node); |
251 | 251 | } : [], |
252 | 252 | // Note: While this could make early assertions to get the correctly |
253 | 253 | // typed values, that would throw immediately while type system |
254 | 254 | // validation with validateSchema() will produce more actionable results. |
255 | - 'interfaces' => function () use ($node) { |
|
256 | - return $node->hasInterfaces() ? \array_map(function (NodeInterface $interface) { |
|
255 | + 'interfaces' => function() use ($node) { |
|
256 | + return $node->hasInterfaces() ? \array_map(function(NodeInterface $interface) { |
|
257 | 257 | return $this->buildType($interface); |
258 | 258 | }, $node->getInterfaces()) : []; |
259 | 259 | }, |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | { |
270 | 270 | return keyValueMap( |
271 | 271 | $node->getFields(), |
272 | - function ($value) { |
|
272 | + function($value) { |
|
273 | 273 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
274 | 274 | return $value->getNameValue(); |
275 | 275 | }, |
276 | - function ($value) use ($node) { |
|
276 | + function($value) use ($node) { |
|
277 | 277 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
278 | 278 | $resolve = null !== $this->resolverRegistry |
279 | 279 | ? $this->resolverRegistry->lookup($node->getNameValue(), $value->getNameValue()) |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | return newInterfaceType([ |
294 | 294 | 'name' => $node->getNameValue(), |
295 | 295 | 'description' => $node->getDescriptionValue(), |
296 | - 'fields' => $node->hasFields() ? function () use ($node): array { |
|
296 | + 'fields' => $node->hasFields() ? function() use ($node) : array { |
|
297 | 297 | return $this->buildFields($node); |
298 | 298 | } : [], |
299 | 299 | 'astNode' => $node, |
@@ -311,10 +311,10 @@ discard block |
||
311 | 311 | 'description' => $node->getDescriptionValue(), |
312 | 312 | 'values' => $node->hasValues() ? keyValueMap( |
313 | 313 | $node->getValues(), |
314 | - function (EnumValueDefinitionNode $value): string { |
|
314 | + function(EnumValueDefinitionNode $value): string { |
|
315 | 315 | return $value->getNameValue(); |
316 | 316 | }, |
317 | - function (EnumValueDefinitionNode $value): array { |
|
317 | + function(EnumValueDefinitionNode $value): array { |
|
318 | 318 | return [ |
319 | 319 | 'description' => $value->getDescriptionValue(), |
320 | 320 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | return newUnionType([ |
336 | 336 | 'name' => $node->getNameValue(), |
337 | 337 | 'description' => $node->getDescriptionValue(), |
338 | - 'types' => $node->hasTypes() ? \array_map(function (TypeNodeInterface $type) { |
|
338 | + 'types' => $node->hasTypes() ? \array_map(function(TypeNodeInterface $type) { |
|
339 | 339 | return $this->buildType($type); |
340 | 340 | }, $node->getTypes()) : [], |
341 | 341 | 'astNode' => $node, |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | return newScalarType([ |
352 | 352 | 'name' => $node->getNameValue(), |
353 | 353 | 'description' => $node->getDescriptionValue(), |
354 | - 'serialize' => function ($value) { |
|
354 | + 'serialize' => function($value) { |
|
355 | 355 | return $value; |
356 | 356 | }, |
357 | 357 | 'astNode' => $node, |
@@ -367,13 +367,13 @@ discard block |
||
367 | 367 | return newInputObjectType([ |
368 | 368 | 'name' => $node->getNameValue(), |
369 | 369 | 'description' => $node->getDescriptionValue(), |
370 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
370 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
371 | 371 | return keyValueMap( |
372 | 372 | $node->getFields(), |
373 | - function (InputValueDefinitionNode $value): string { |
|
373 | + function(InputValueDefinitionNode $value): string { |
|
374 | 374 | return $value->getNameValue(); |
375 | 375 | }, |
376 | - function (InputValueDefinitionNode $value): array { |
|
376 | + function(InputValueDefinitionNode $value): array { |
|
377 | 377 | $type = $this->buildWrappedType($value->getType()); |
378 | 378 | $defaultValue = $value->getDefaultValue(); |
379 | 379 | return [ |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getExtendedTypes(): array |
113 | 113 | { |
114 | - $extendedTypes = \array_map(function ($type) { |
|
114 | + $extendedTypes = \array_map(function($type) { |
|
115 | 115 | return $this->getExtendedType($type); |
116 | 116 | }, $this->info->getSchema()->getTypeMap()); |
117 | 117 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | return \array_merge( |
135 | 135 | $existingDirectives, |
136 | - \array_map(function (DirectiveDefinitionNode $node) { |
|
136 | + \array_map(function(DirectiveDefinitionNode $node) { |
|
137 | 137 | return $this->definitionBuilder->buildDirective($node); |
138 | 138 | }, $this->info->getDirectiveDefinitions()) |
139 | 139 | ); |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | return newObjectType([ |
239 | 239 | 'name' => $typeName, |
240 | 240 | 'description' => $type->getDescription(), |
241 | - 'interfaces' => function () use ($type) { |
|
241 | + 'interfaces' => function() use ($type) { |
|
242 | 242 | return $this->extendImplementedInterfaces($type); |
243 | 243 | }, |
244 | - 'fields' => function () use ($type) { |
|
244 | + 'fields' => function() use ($type) { |
|
245 | 245 | return $this->extendFieldMap($type); |
246 | 246 | }, |
247 | 247 | 'astNode' => $type->getAstNode(), |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | return newInterfaceType([ |
267 | 267 | 'name' => $typeName, |
268 | 268 | 'description' => $type->getDescription(), |
269 | - 'fields' => function () use ($type) { |
|
269 | + 'fields' => function() use ($type) { |
|
270 | 270 | return $this->extendFieldMap($type); |
271 | 271 | }, |
272 | 272 | 'astNode' => $type->getAstNode(), |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | return newUnionType([ |
297 | 297 | 'name' => $type->getName(), |
298 | 298 | 'description' => $type->getDescription(), |
299 | - 'types' => \array_map(function ($unionType) { |
|
299 | + 'types' => \array_map(function($unionType) { |
|
300 | 300 | return $this->getExtendedType($unionType); |
301 | 301 | }, $type->getTypes()), |
302 | 302 | 'astNode' => $type->getAstNode(), |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | { |
314 | 314 | $typeName = $type->getName(); |
315 | 315 | |
316 | - $interfaces = \array_map(function (InterfaceType $interface) { |
|
316 | + $interfaces = \array_map(function(InterfaceType $interface) { |
|
317 | 317 | return $this->getExtendedType($interface); |
318 | 318 | }, $type->getInterfaces()); |
319 | 319 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | 'description' => $field->getDescription(), |
356 | 356 | 'deprecationReason' => $field->getDeprecationReason(), |
357 | 357 | 'type' => $this->extendFieldType($field->getType()), |
358 | - 'args' => keyMap($field->getArguments(), function (Argument $argument) { |
|
358 | + 'args' => keyMap($field->getArguments(), function(Argument $argument) { |
|
359 | 359 | return $argument->getName(); |
360 | 360 | }), |
361 | 361 | 'astNode' => $field->getAstNode(), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return mixed |
126 | 126 | * @throws SyntaxErrorException |
127 | 127 | */ |
128 | - $buildValue = function (LexerInterface $lexer) { |
|
128 | + $buildValue = function(LexerInterface $lexer) { |
|
129 | 129 | $this->expect($lexer, TokenKindEnum::COLON); |
130 | 130 | return $this->buildValueLiteral($lexer); |
131 | 131 | }; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * @return mixed |
153 | 153 | * @throws SyntaxErrorException |
154 | 154 | */ |
155 | - $buildValue = function (LexerInterface $lexer) { |
|
155 | + $buildValue = function(LexerInterface $lexer) { |
|
156 | 156 | $this->expect($lexer, TokenKindEnum::COLON); |
157 | 157 | return $this->buildValueLiteral($lexer); |
158 | 158 | }; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function buildArgumentsDefinition(LexerInterface $lexer): ?array |
174 | 174 | { |
175 | - $buildFunction = function (LexerInterface $lexer): array { |
|
175 | + $buildFunction = function(LexerInterface $lexer): array { |
|
176 | 176 | return $this->buildInputValueDefinition($lexer); |
177 | 177 | }; |
178 | 178 | |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | |
641 | 641 | $this->expectKeyword($lexer, KeywordEnum::FRAGMENT); |
642 | 642 | |
643 | - $buildTypeCondition = function (LexerInterface $lexer) { |
|
643 | + $buildTypeCondition = function(LexerInterface $lexer) { |
|
644 | 644 | $this->expectKeyword($lexer, 'on'); |
645 | 645 | return $this->buildNamedType($lexer); |
646 | 646 | }; |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | */ |
701 | 701 | protected function buildInputFieldsDefinition(LexerInterface $lexer): ?array |
702 | 702 | { |
703 | - $buildFunction = function (LexerInterface $lexer): array { |
|
703 | + $buildFunction = function(LexerInterface $lexer): array { |
|
704 | 704 | return $this->buildInputValueDefinition($lexer); |
705 | 705 | }; |
706 | 706 | |
@@ -1357,7 +1357,7 @@ discard block |
||
1357 | 1357 | { |
1358 | 1358 | $start = $lexer->getToken(); |
1359 | 1359 | |
1360 | - $buildValue = function (LexerInterface $lexer, bool $isConst) { |
|
1360 | + $buildValue = function(LexerInterface $lexer, bool $isConst) { |
|
1361 | 1361 | $this->expect($lexer, TokenKindEnum::COLON); |
1362 | 1362 | |
1363 | 1363 | return $this->buildValueLiteral($lexer, $isConst); |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | * @return mixed |
1416 | 1416 | * @throws SyntaxErrorException |
1417 | 1417 | */ |
1418 | - $buildType = function (LexerInterface $lexer) { |
|
1418 | + $buildType = function(LexerInterface $lexer) { |
|
1419 | 1419 | $this->expect($lexer, TokenKindEnum::COLON); |
1420 | 1420 | |
1421 | 1421 | return $this->buildTypeReference($lexer); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ->withArgument(ASTBuilderInterface::class) |
32 | 32 | ->withArgument(NodeBuilderInterface::class); |
33 | 33 | |
34 | - $this->container->add(LexerInterface::class, function () { |
|
34 | + $this->container->add(LexerInterface::class, function() { |
|
35 | 35 | return new Lexer(SupportedReaders::get()); |
36 | 36 | }); |
37 | 37 |