@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $builtInTypes = keyMap( |
| 80 | 80 | array_merge(specifiedScalarTypes(), introspectionTypes()), |
| 81 | - function (NamedTypeInterface $type) { |
|
| 81 | + function(NamedTypeInterface $type) { |
|
| 82 | 82 | return $type->getName(); |
| 83 | 83 | } |
| 84 | 84 | ); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return GraphQLDirective([ |
| 134 | 134 | 'name' => $node->getNameValue(), |
| 135 | 135 | 'description' => $node->getDescriptionValue(), |
| 136 | - 'locations' => array_map(function (NameNode $node) { |
|
| 136 | + 'locations' => array_map(function(NameNode $node) { |
|
| 137 | 137 | return $node->getValue(); |
| 138 | 138 | }, $node->getLocations()), |
| 139 | 139 | 'arguments' => $node->hasArguments() ? $this->buildArguments($node->getArguments()) : [], |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | { |
| 181 | 181 | return keyValMap( |
| 182 | 182 | $nodes, |
| 183 | - function (InputValueDefinitionNode $value) { |
|
| 183 | + function(InputValueDefinitionNode $value) { |
|
| 184 | 184 | return $value->getNameValue(); |
| 185 | 185 | }, |
| 186 | - function (InputValueDefinitionNode $value): array { |
|
| 186 | + function(InputValueDefinitionNode $value): array { |
|
| 187 | 187 | $type = $this->buildWrappedType($value->getType()); |
| 188 | 188 | return [ |
| 189 | 189 | 'type' => $type, |
@@ -232,11 +232,11 @@ discard block |
||
| 232 | 232 | return GraphQLObjectType([ |
| 233 | 233 | 'name' => $node->getNameValue(), |
| 234 | 234 | 'description' => $node->getDescriptionValue(), |
| 235 | - 'fields' => function () use ($node) { |
|
| 235 | + 'fields' => function() use ($node) { |
|
| 236 | 236 | return $this->buildFields($node); |
| 237 | 237 | }, |
| 238 | - 'interfaces' => function () use ($node) { |
|
| 239 | - return $node->hasInterfaces() ? array_map(function (InterfaceTypeDefinitionNode $interface) { |
|
| 238 | + 'interfaces' => function() use ($node) { |
|
| 239 | + return $node->hasInterfaces() ? array_map(function(InterfaceTypeDefinitionNode $interface) { |
|
| 240 | 240 | return $this->buildType($interface); |
| 241 | 241 | }, $node->getInterfaces()) : []; |
| 242 | 242 | }, |
@@ -253,11 +253,11 @@ discard block |
||
| 253 | 253 | { |
| 254 | 254 | return $node->hasFields() ? keyValMap( |
| 255 | 255 | $node->getFields(), |
| 256 | - function ($value) { |
|
| 256 | + function($value) { |
|
| 257 | 257 | /** @noinspection PhpUndefinedMethodInspection */ |
| 258 | 258 | return $value->getNameValue(); |
| 259 | 259 | }, |
| 260 | - function ($value) { |
|
| 260 | + function($value) { |
|
| 261 | 261 | return $this->buildField($value); |
| 262 | 262 | } |
| 263 | 263 | ) : []; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | return GraphQLInterfaceType([ |
| 273 | 273 | 'name' => $node->getNameValue(), |
| 274 | 274 | 'description' => $node->getDescriptionValue(), |
| 275 | - 'fields' => function () use ($node): array { |
|
| 275 | + 'fields' => function() use ($node): array { |
|
| 276 | 276 | return $this->buildFields($node); |
| 277 | 277 | }, |
| 278 | 278 | 'astNode' => $node, |
@@ -290,10 +290,10 @@ discard block |
||
| 290 | 290 | 'description' => $node->getDescriptionValue(), |
| 291 | 291 | 'values' => $node->hasValues() ? keyValMap( |
| 292 | 292 | $node->getValues(), |
| 293 | - function (EnumValueDefinitionNode $value): string { |
|
| 293 | + function(EnumValueDefinitionNode $value): string { |
|
| 294 | 294 | return $value->getNameValue(); |
| 295 | 295 | }, |
| 296 | - function (EnumValueDefinitionNode $value): array { |
|
| 296 | + function(EnumValueDefinitionNode $value): array { |
|
| 297 | 297 | return [ |
| 298 | 298 | 'description' => $value->getDescriptionValue(), |
| 299 | 299 | 'deprecationReason' => getDeprecationReason($value), |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | return GraphQLUnionType([ |
| 311 | 311 | 'name' => $node->getNameValue(), |
| 312 | 312 | 'description' => $node->getDescriptionValue(), |
| 313 | - 'types' => $node->hasTypes() ? array_map(function (TypeNodeInterface $type) { |
|
| 313 | + 'types' => $node->hasTypes() ? array_map(function(TypeNodeInterface $type) { |
|
| 314 | 314 | return $this->buildType($type); |
| 315 | 315 | }, $node->getTypes()) : [], |
| 316 | 316 | 'astNode' => $node, |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | return GraphQLScalarType([ |
| 327 | 327 | 'name' => $node->getNameValue(), |
| 328 | 328 | 'description' => $node->getDescriptionValue(), |
| 329 | - 'serialize' => function ($value) { |
|
| 329 | + 'serialize' => function($value) { |
|
| 330 | 330 | return $value; |
| 331 | 331 | }, |
| 332 | 332 | 'astNode' => $node, |
@@ -346,10 +346,10 @@ discard block |
||
| 346 | 346 | 'description' => $node->getDescriptionValue(), |
| 347 | 347 | 'fields' => $node->hasFields() ? keyValMap( |
| 348 | 348 | $node->getFields(), |
| 349 | - function (InputValueDefinitionNode $value): string { |
|
| 349 | + function(InputValueDefinitionNode $value): string { |
|
| 350 | 350 | return $value->getNameValue(); |
| 351 | 351 | }, |
| 352 | - function (InputValueDefinitionNode $value): array { |
|
| 352 | + function(InputValueDefinitionNode $value): array { |
|
| 353 | 353 | $type = $this->buildWrappedType($value->getType()); |
| 354 | 354 | return [ |
| 355 | 355 | 'type' => $type, |
@@ -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(); |
@@ -691,13 +691,13 @@ |
||
| 691 | 691 | |
| 692 | 692 | return new Conflict( |
| 693 | 693 | $responseName, |
| 694 | - array_map(function (Conflict $conflict) { |
|
| 694 | + array_map(function(Conflict $conflict) { |
|
| 695 | 695 | return [$conflict->getResponseName(), $conflict->getReason()]; |
| 696 | 696 | }, $conflicts), |
| 697 | - array_reduce($conflicts, function ($allFields, Conflict $conflict) { |
|
| 697 | + array_reduce($conflicts, function($allFields, Conflict $conflict) { |
|
| 698 | 698 | return array_merge($allFields, $conflict->getFieldsA()); |
| 699 | 699 | }, [$nodeA]), |
| 700 | - array_reduce($conflicts, function ($allFields, Conflict $conflict) { |
|
| 700 | + array_reduce($conflicts, function($allFields, Conflict $conflict) { |
|
| 701 | 701 | return array_merge($allFields, $conflict->getFieldsB()); |
| 702 | 702 | }, [$nodeB]) |
| 703 | 703 | ); |
@@ -218,7 +218,7 @@ |
||
| 218 | 218 | return conflictReasonMessage([$reason]); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - return implode(' and ', array_map(function ($reason) { |
|
| 221 | + return implode(' and ', array_map(function($reason) { |
|
| 222 | 222 | [$responseName, $subreason] = $reason; |
| 223 | 223 | return sprintf('subfields "%s" conflict because %s', $responseName, conflictReasonMessage($subreason)); |
| 224 | 224 | }, $reason)); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getDirective(string $name): ?Directive |
| 127 | 127 | { |
| 128 | - return find($this->directives, function (Directive $directive) use ($name) { |
|
| 128 | + return find($this->directives, function(Directive $directive) use ($name) { |
|
| 129 | 129 | return $directive->getName() === $name; |
| 130 | 130 | }); |
| 131 | 131 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | ) |
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | - $this->_possibleTypeMap[$abstractTypeName] = array_reduce($possibleTypes, function (array $map, TypeInterface $type) { |
|
| 180 | + $this->_possibleTypeMap[$abstractTypeName] = array_reduce($possibleTypes, function(array $map, TypeInterface $type) { |
|
| 181 | 181 | $map[$type->getName()] = true; |
| 182 | 182 | return $map; |
| 183 | 183 | }, []); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | if ($type instanceof ObjectType || $type instanceof InterfaceType) { |
| 389 | 389 | foreach ($type->getFields() as $field) { |
| 390 | 390 | if ($field->hasArguments()) { |
| 391 | - $fieldArgTypes = array_map(function (Argument $argument) { |
|
| 391 | + $fieldArgTypes = array_map(function(Argument $argument) { |
|
| 392 | 392 | return $argument->getType(); |
| 393 | 393 | }, $field->getArguments()); |
| 394 | 394 | |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | return $map; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | - return array_reduce($directive->getArguments(), function ($map, Argument $argument) { |
|
| 422 | + return array_reduce($directive->getArguments(), function($map, Argument $argument) { |
|
| 423 | 423 | return typeMapReducer($map, $argument->getType()); |
| 424 | 424 | }, $map); |
| 425 | 425 | } |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | */ |
| 147 | 147 | function locationsShorthandToArray(array $locations): array |
| 148 | 148 | { |
| 149 | - return array_map(function ($shorthand) { |
|
| 149 | + return array_map(function($shorthand) { |
|
| 150 | 150 | return locationShorthandToArray($shorthand); |
| 151 | 151 | }, $locations); |
| 152 | 152 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | // If both types are abstract, then determine if there is any intersection |
| 93 | 93 | // between possible concrete types of each. |
| 94 | 94 | return arraySome($schema->getPossibleTypes($typeA), |
| 95 | - function (TypeInterface $type) use ($schema, $typeB) { |
|
| 95 | + function(TypeInterface $type) use ($schema, $typeB) { |
|
| 96 | 96 | return $schema->isPossibleType($typeB, $type); |
| 97 | 97 | }); |
| 98 | 98 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | return $count === 1 |
| 20 | 20 | ? $selected[0] |
| 21 | - : array_reduce($selected, function ($list, $item) use ($count, &$index) { |
|
| 21 | + : array_reduce($selected, function($list, $item) use ($count, &$index) { |
|
| 22 | 22 | $list .= ($index > 0 && $index < ($count - 1) ? ', ' : '') . ($index === ($count - 1) ? ' or ' : '') . |
| 23 | 23 | $item; |
| 24 | 24 | $index++; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function quotedOrList(array $items): string |
| 36 | 36 | { |
| 37 | - return orList(array_map(function ($item) { |
|
| 37 | + return orList(array_map(function($item) { |
|
| 38 | 38 | return '"' . $item . '"'; |
| 39 | 39 | }, $items)); |
| 40 | 40 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | $result = \array_keys($optionsByDistance); |
| 27 | 27 | |
| 28 | - \usort($result, function ($a, $b) use ($optionsByDistance) { |
|
| 28 | + \usort($result, function($a, $b) use ($optionsByDistance) { |
|
| 29 | 29 | return $optionsByDistance[$a] - $optionsByDistance[$b]; |
| 30 | 30 | }); |
| 31 | 31 | |