@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | ) |
| 165 | 165 | ); |
| 166 | 166 | |
| 167 | - $this->_possibleTypeMap = array_reduce($possibleTypes, function (array $map, TypeInterface $type) { |
|
| 167 | + $this->_possibleTypeMap = array_reduce($possibleTypes, function(array $map, TypeInterface $type) { |
|
| 168 | 168 | $map[$type->getName()] = true; |
| 169 | 169 | return $map; |
| 170 | 170 | }); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
| 377 | 377 | foreach ($type->getFields() as $field) { |
| 378 | 378 | if ($field->hasArguments()) { |
| 379 | - $fieldArgTypes = array_map(function (Argument $argument) { |
|
| 379 | + $fieldArgTypes = array_map(function(Argument $argument) { |
|
| 380 | 380 | return $argument->getType(); |
| 381 | 381 | }, $field->getArguments()); |
| 382 | 382 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | return $map; |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | - return array_reduce($directive->getArguments(), function ($map, Argument $argument) { |
|
| 410 | + return array_reduce($directive->getArguments(), function($map, Argument $argument) { |
|
| 411 | 411 | return typeMapReducer($map, $argument->getType()); |
| 412 | 412 | }, $map); |
| 413 | 413 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $documentNode = parse($source, $options); |
| 25 | 25 | |
| 26 | 26 | if (null === $instance) { |
| 27 | - $resolveType = function (NamedTypeNode $node) { |
|
| 27 | + $resolveType = function(NamedTypeNode $node) { |
|
| 28 | 28 | throw new \Exception(sprintf('Type "%s" not found in document.', $node->getNameValue())); |
| 29 | 29 | }; |
| 30 | 30 | |
@@ -78,27 +78,27 @@ |
||
| 78 | 78 | |
| 79 | 79 | $this->definitionBuilder->setTypeDefinitionMap($nodeMap); |
| 80 | 80 | |
| 81 | - $types = array_map(function (TypeDefinitionNodeInterface $definition) { |
|
| 81 | + $types = array_map(function(TypeDefinitionNodeInterface $definition) { |
|
| 82 | 82 | return $this->definitionBuilder->buildType($definition); |
| 83 | 83 | }, $typeDefinitions); |
| 84 | 84 | |
| 85 | - $directives = array_map(function (DirectiveDefinitionNode $definition) { |
|
| 85 | + $directives = array_map(function(DirectiveDefinitionNode $definition) { |
|
| 86 | 86 | return $this->definitionBuilder->buildDirective($definition); |
| 87 | 87 | }, $directiveDefinitions); |
| 88 | 88 | |
| 89 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 89 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 90 | 90 | return $directive->getName() === 'skip'; |
| 91 | 91 | })) { |
| 92 | 92 | $directives[] = GraphQLSkipDirective(); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 95 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 96 | 96 | return $directive->getName() === 'include'; |
| 97 | 97 | })) { |
| 98 | 98 | $directives[] = GraphQLIncludeDirective(); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if (!arraySome($directives, function (DirectiveInterface $directive) { |
|
| 101 | + if (!arraySome($directives, function(DirectiveInterface $directive) { |
|
| 102 | 102 | return $directive->getName() === 'deprecated'; |
| 103 | 103 | })) { |
| 104 | 104 | $directives[] = GraphQLDeprecatedDirective(); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | function arraySome(array $array, callable $fn) |
| 25 | 25 | { |
| 26 | - return array_reduce($array, function ($result, $value) use ($fn) { |
|
| 26 | + return array_reduce($array, function($result, $value) use ($fn) { |
|
| 27 | 27 | return $result || $fn($value); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function keyMap(array $array, callable $keyFn): array |
| 37 | 37 | { |
| 38 | - return array_reduce($array, function ($map, $item) use ($keyFn) { |
|
| 38 | + return array_reduce($array, function($map, $item) use ($keyFn) { |
|
| 39 | 39 | $map[$keyFn($item)] = $item; |
| 40 | 40 | return $map; |
| 41 | 41 | }, []); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function keyValMap(array $array, callable $keyFn, callable $valFn): array |
| 51 | 51 | { |
| 52 | - return array_reduce($array, function ($map, $item) use ($keyFn, $valFn) { |
|
| 52 | + return array_reduce($array, function($map, $item) use ($keyFn, $valFn) { |
|
| 53 | 53 | $map[$keyFn($item)] = $valFn($item); |
| 54 | 54 | return $map; |
| 55 | 55 | }, []); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | $builtInTypes = keyMap( |
| 78 | 78 | array_merge(specifiedScalarTypes()/*, introspectionTypes()*/), |
| 79 | - function (NamedTypeInterface $type) { |
|
| 79 | + function(NamedTypeInterface $type) { |
|
| 80 | 80 | return $type->getName(); |
| 81 | 81 | } |
| 82 | 82 | ); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | return GraphQLDirective([ |
| 130 | 130 | 'name' => $node->getNameValue(), |
| 131 | 131 | 'description' => $node->getDescriptionValue(), |
| 132 | - 'locations' => array_map(function (NameNode $node) { |
|
| 132 | + 'locations' => array_map(function(NameNode $node) { |
|
| 133 | 133 | return $node->getValue(); |
| 134 | 134 | }, $node->getLocations()), |
| 135 | 135 | 'arguments' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | return keyValMap( |
| 176 | 176 | $nodes, |
| 177 | - function (InputValueDefinitionNode $value) { |
|
| 177 | + function(InputValueDefinitionNode $value) { |
|
| 178 | 178 | return $value->getNameValue(); |
| 179 | 179 | }, |
| 180 | - function (InputValueDefinitionNode $value): array { |
|
| 180 | + function(InputValueDefinitionNode $value): array { |
|
| 181 | 181 | $type = $this->buildWrappedType($value->getType()); |
| 182 | 182 | return [ |
| 183 | 183 | 'type' => $type, |
@@ -226,11 +226,11 @@ discard block |
||
| 226 | 226 | return GraphQLObjectType([ |
| 227 | 227 | 'name' => $node->getNameValue(), |
| 228 | 228 | 'description' => $node->getDescriptionValue(), |
| 229 | - 'fields' => function () use ($node) { |
|
| 229 | + 'fields' => function() use ($node) { |
|
| 230 | 230 | return $this->buildFields($node); |
| 231 | 231 | }, |
| 232 | - 'interfaces' => function () use ($node) { |
|
| 233 | - return $node->hasInterfaces() ? array_map(function (InterfaceTypeDefinitionNode $interface) { |
|
| 232 | + 'interfaces' => function() use ($node) { |
|
| 233 | + return $node->hasInterfaces() ? array_map(function(InterfaceTypeDefinitionNode $interface) { |
|
| 234 | 234 | return $this->buildType($interface); |
| 235 | 235 | }, $node->getInterfaces()) : []; |
| 236 | 236 | }, |
@@ -245,10 +245,10 @@ discard block |
||
| 245 | 245 | { |
| 246 | 246 | return $node->hasFields() ? keyValMap( |
| 247 | 247 | $node->getFields(), |
| 248 | - function ($value) { |
|
| 248 | + function($value) { |
|
| 249 | 249 | return $value->getNameValue(); |
| 250 | 250 | }, |
| 251 | - function ($value) { |
|
| 251 | + function($value) { |
|
| 252 | 252 | return $this->buildField($value); |
| 253 | 253 | } |
| 254 | 254 | ) : []; |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | return GraphQLInterfaceType([ |
| 264 | 264 | 'name' => $node->getNameValue(), |
| 265 | 265 | 'description' => $node->getDescriptionValue(), |
| 266 | - 'fields' => function () use ($node): array { |
|
| 266 | + 'fields' => function() use ($node): array { |
|
| 267 | 267 | return $this->buildFields($node); |
| 268 | 268 | }, |
| 269 | 269 | 'astNode' => $node, |
@@ -281,10 +281,10 @@ discard block |
||
| 281 | 281 | 'description' => $node->getDescriptionValue(), |
| 282 | 282 | 'values' => $node->hasValues() ? keyValMap( |
| 283 | 283 | $node->getValues(), |
| 284 | - function (EnumValueDefinitionNode $value): string { |
|
| 284 | + function(EnumValueDefinitionNode $value): string { |
|
| 285 | 285 | return $value->getNameValue(); |
| 286 | 286 | }, |
| 287 | - function (EnumValueDefinitionNode $value): array { |
|
| 287 | + function(EnumValueDefinitionNode $value): array { |
|
| 288 | 288 | return [ |
| 289 | 289 | 'description' => $value->getDescriptionValue(), |
| 290 | 290 | 'deprecationReason' => getDeprecationReason($value), |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | return GraphQLUnionType([ |
| 302 | 302 | 'name' => $node->getNameValue(), |
| 303 | 303 | 'description' => $node->getDescriptionValue(), |
| 304 | - 'types' => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) { |
|
| 304 | + 'types' => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) { |
|
| 305 | 305 | return $this->buildType($type); |
| 306 | 306 | }, $node->getTypes()) : [], |
| 307 | 307 | 'astNode' => $node, |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | return GraphQLScalarType([ |
| 318 | 318 | 'name' => $node->getNameValue(), |
| 319 | 319 | 'description' => $node->getDescriptionValue(), |
| 320 | - 'serialize' => function ($value) { |
|
| 320 | + 'serialize' => function($value) { |
|
| 321 | 321 | return $value; |
| 322 | 322 | }, |
| 323 | 323 | 'astNode' => $node, |
@@ -335,10 +335,10 @@ discard block |
||
| 335 | 335 | 'description' => $node->getDescriptionValue(), |
| 336 | 336 | 'fields' => $node->hasFields() ? keyValMap( |
| 337 | 337 | $node->getFields(), |
| 338 | - function (InputValueDefinitionNode $value): string { |
|
| 338 | + function(InputValueDefinitionNode $value): string { |
|
| 339 | 339 | return $value->getNameValue(); |
| 340 | 340 | }, |
| 341 | - function (InputValueDefinitionNode $value): array { |
|
| 341 | + function(InputValueDefinitionNode $value): array { |
|
| 342 | 342 | $type = $this->buildWrappedType($value->getType()); |
| 343 | 343 | return [ |
| 344 | 344 | 'type' => $type, |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return $coercedValues; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $argumentNodeMap = keyMap($argumentNodes, function (ArgumentNode $value) { |
|
| 38 | + $argumentNodeMap = keyMap($argumentNodes, function(ArgumentNode $value) { |
|
| 39 | 39 | return $value->getNameValue(); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | function getDirectiveValues(DirectiveInterface $directive, NodeInterface $node, array $variableValues = []): ?array |
| 106 | 106 | { |
| 107 | 107 | $directiveNode = $node->hasDirectives() |
| 108 | - ? find($node->getDirectives(), function (NamedTypeNode $value) use ($directive) { |
|
| 108 | + ? find($node->getDirectives(), function(NamedTypeNode $value) use ($directive) { |
|
| 109 | 109 | return $value->getNameValue() === $directive->getName(); |
| 110 | 110 | }) : null; |
| 111 | 111 | |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | $coercedObject = []; |
| 102 | 102 | |
| 103 | 103 | /** @var ObjectFieldNode[] $fieldNodes */ |
| 104 | - $fieldNodes = keyMap($node->getFields(), function (FieldNode $value) { |
|
| 104 | + $fieldNodes = keyMap($node->getFields(), function(FieldNode $value) { |
|
| 105 | 105 | return $value->getNameValue(); |
| 106 | 106 | }); |
| 107 | 107 | |