@@ -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 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $nodes = [$nodes]; |
194 | 194 | } |
195 | 195 | |
196 | - $this->nodes = \array_filter($nodes, function ($node) { |
|
196 | + $this->nodes = \array_filter($nodes, function($node) { |
|
197 | 197 | return null !== $node; |
198 | 198 | }); |
199 | 199 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | protected function resolvePositions(?array $positions) |
225 | 225 | { |
226 | 226 | if (null === $positions && !empty($this->nodes)) { |
227 | - $positions = \array_reduce($this->nodes, function (array $list, ?NodeInterface $node) { |
|
227 | + $positions = \array_reduce($this->nodes, function(array $list, ?NodeInterface $node) { |
|
228 | 228 | if (null !== $node) { |
229 | 229 | $location = $node->getLocation(); |
230 | 230 | if (null !== $location) { |
@@ -252,11 +252,11 @@ discard block |
||
252 | 252 | protected function resolveLocations(?array $positions, ?Source $source) |
253 | 253 | { |
254 | 254 | if (null !== $positions && null !== $source) { |
255 | - $locations = \array_map(function ($position) use ($source) { |
|
255 | + $locations = \array_map(function($position) use ($source) { |
|
256 | 256 | return SourceLocation::fromSource($source, $position); |
257 | 257 | }, $positions); |
258 | 258 | } elseif (!empty($this->nodes)) { |
259 | - $locations = \array_reduce($this->nodes, function (array $list, NodeInterface $node) { |
|
259 | + $locations = \array_reduce($this->nodes, function(array $list, NodeInterface $node) { |
|
260 | 260 | $location = $node->getLocation(); |
261 | 261 | if (null !== $location) { |
262 | 262 | $list[] = SourceLocation::fromSource($location->getSource(), $location->getStart()); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function buildTypes(array $nodes): array |
110 | 110 | { |
111 | - return \array_map(function (NameAwareInterface $node) { |
|
111 | + return \array_map(function(NameAwareInterface $node) { |
|
112 | 112 | return $this->buildType($node); |
113 | 113 | }, $nodes); |
114 | 114 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $directive = newDirective([ |
156 | 156 | 'name' => $node->getNameValue(), |
157 | 157 | 'description' => $node->getDescriptionValue(), |
158 | - 'locations' => \array_map(function (NameNode $node) { |
|
158 | + 'locations' => \array_map(function(NameNode $node) { |
|
159 | 159 | return $node->getValue(); |
160 | 160 | }, $node->getLocations()), |
161 | 161 | 'args' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | { |
223 | 223 | $typesMap = keyMap( |
224 | 224 | \array_merge($customTypes, specifiedScalarTypes(), introspectionTypes()), |
225 | - function (NamedTypeInterface $type) { |
|
225 | + function(NamedTypeInterface $type) { |
|
226 | 226 | return $type->getName(); |
227 | 227 | } |
228 | 228 | ); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | { |
240 | 240 | $directivesMap = keyMap( |
241 | 241 | \array_merge($customDirectives, specifiedDirectives()), |
242 | - function (Directive $directive) { |
|
242 | + function(Directive $directive) { |
|
243 | 243 | return $directive->getName(); |
244 | 244 | } |
245 | 245 | ); |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | { |
259 | 259 | return keyValueMap( |
260 | 260 | $nodes, |
261 | - function (InputValueDefinitionNode $value) { |
|
261 | + function(InputValueDefinitionNode $value) { |
|
262 | 262 | return $value->getNameValue(); |
263 | 263 | }, |
264 | - function (InputValueDefinitionNode $value): array { |
|
264 | + function(InputValueDefinitionNode $value): array { |
|
265 | 265 | $type = $this->buildWrappedType($value->getType()); |
266 | 266 | $defaultValue = $value->getDefaultValue(); |
267 | 267 | return [ |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | return newObjectType([ |
316 | 316 | 'name' => $node->getNameValue(), |
317 | 317 | 'description' => $node->getDescriptionValue(), |
318 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
318 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
319 | 319 | return $this->buildFields($node); |
320 | 320 | } : [], |
321 | 321 | // Note: While this could make early assertions to get the correctly |
322 | 322 | // typed values, that would throw immediately while type system |
323 | 323 | // validation with validateSchema() will produce more actionable results. |
324 | - 'interfaces' => function () use ($node) { |
|
325 | - return $node->hasInterfaces() ? \array_map(function (NameAwareInterface $interface) { |
|
324 | + 'interfaces' => function() use ($node) { |
|
325 | + return $node->hasInterfaces() ? \array_map(function(NameAwareInterface $interface) { |
|
326 | 326 | return $this->buildType($interface); |
327 | 327 | }, $node->getInterfaces()) : []; |
328 | 328 | }, |
@@ -338,11 +338,11 @@ discard block |
||
338 | 338 | { |
339 | 339 | return keyValueMap( |
340 | 340 | $node->getFields(), |
341 | - function ($value) { |
|
341 | + function($value) { |
|
342 | 342 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
343 | 343 | return $value->getNameValue(); |
344 | 344 | }, |
345 | - function ($value) use ($node) { |
|
345 | + function($value) use ($node) { |
|
346 | 346 | /** @var FieldDefinitionNode|InputValueDefinitionNode $value */ |
347 | 347 | return $this->buildField($value, |
348 | 348 | $this->getFieldResolver($node->getNameValue(), $value->getNameValue())); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | return newInterfaceType([ |
373 | 373 | 'name' => $node->getNameValue(), |
374 | 374 | 'description' => $node->getDescriptionValue(), |
375 | - 'fields' => $node->hasFields() ? function () use ($node): array { |
|
375 | + 'fields' => $node->hasFields() ? function() use ($node) : array { |
|
376 | 376 | return $this->buildFields($node); |
377 | 377 | } : [], |
378 | 378 | 'resolveType' => $this->getTypeResolver($node->getNameValue()), |
@@ -392,10 +392,10 @@ discard block |
||
392 | 392 | 'description' => $node->getDescriptionValue(), |
393 | 393 | 'values' => $node->hasValues() ? keyValueMap( |
394 | 394 | $node->getValues(), |
395 | - function (EnumValueDefinitionNode $value): ?string { |
|
395 | + function(EnumValueDefinitionNode $value): ?string { |
|
396 | 396 | return $value->getNameValue(); |
397 | 397 | }, |
398 | - function (EnumValueDefinitionNode $value): array { |
|
398 | + function(EnumValueDefinitionNode $value): array { |
|
399 | 399 | return [ |
400 | 400 | 'description' => $value->getDescriptionValue(), |
401 | 401 | 'deprecationReason' => $this->getDeprecationReason($value), |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | return newUnionType([ |
418 | 418 | 'name' => $node->getNameValue(), |
419 | 419 | 'description' => $node->getDescriptionValue(), |
420 | - 'types' => $node->hasTypes() ? \array_map(function (NameAwareInterface $type) { |
|
420 | + 'types' => $node->hasTypes() ? \array_map(function(NameAwareInterface $type) { |
|
421 | 421 | return $this->buildType($type); |
422 | 422 | }, $node->getTypes()) : [], |
423 | 423 | 'resolveType' => $this->getTypeResolver($node->getNameValue()), |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | return newScalarType([ |
447 | 447 | 'name' => $node->getNameValue(), |
448 | 448 | 'description' => $node->getDescriptionValue(), |
449 | - 'serialize' => function ($value) { |
|
449 | + 'serialize' => function($value) { |
|
450 | 450 | return $value; |
451 | 451 | }, |
452 | 452 | 'astNode' => $node, |
@@ -463,13 +463,13 @@ discard block |
||
463 | 463 | return newInputObjectType([ |
464 | 464 | 'name' => $node->getNameValue(), |
465 | 465 | 'description' => $node->getDescriptionValue(), |
466 | - 'fields' => $node->hasFields() ? function () use ($node) { |
|
466 | + 'fields' => $node->hasFields() ? function() use ($node) { |
|
467 | 467 | return keyValueMap( |
468 | 468 | $node->getFields(), |
469 | - function (InputValueDefinitionNode $value): ?string { |
|
469 | + function(InputValueDefinitionNode $value): ?string { |
|
470 | 470 | return $value->getNameValue(); |
471 | 471 | }, |
472 | - function (InputValueDefinitionNode $value): array { |
|
472 | + function(InputValueDefinitionNode $value): array { |
|
473 | 473 | $type = $this->buildWrappedType($value->getType()); |
474 | 474 | $defaultValue = $value->getDefaultValue(); |
475 | 475 | return [ |