From 0efc562148c718bd3316d12f244731cc2968ea4b Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Mon, 2 Sep 2024 09:54:09 +0200 Subject: [PATCH] Revert fixer --- composer.json | 2 +- src/Error/CoercionError.php | 2 +- src/Error/Error.php | 2 +- src/Executor/ExecutionContext.php | 2 +- src/Executor/Executor.php | 4 +-- src/Executor/ReferenceExecutor.php | 26 +++++++++---------- src/GraphQL.php | 4 +-- src/Server/Helper.php | 8 +++--- src/Server/StandardServer.php | 2 +- src/Type/Definition/ResolveInfo.php | 2 +- src/Utils/ASTDefinitionBuilder.php | 2 +- src/Utils/BreakingChangesFinder.php | 26 +++++++++---------- src/Utils/BuildSchema.php | 6 ++--- src/Utils/SchemaExtender.php | 4 +-- src/Validator/DocumentValidator.php | 4 +-- src/Validator/Rules/FieldsOnCorrectType.php | 2 +- src/Validator/Rules/KnownDirectives.php | 2 +- .../Rules/OverlappingFieldsCanBeMerged.php | 22 ++++++++-------- src/Validator/Rules/QuerySecurityRule.php | 2 +- tests/Executor/Promise/SyncPromiseTest.php | 14 +++++----- tests/Executor/UnionInterfaceTest.php | 2 +- tests/Language/ParserTest.php | 2 +- tests/Server/RequestParsingTest.php | 2 +- tests/Type/QueryPlanTest.php | 4 +-- tests/Type/ResolveInfoTest.php | 6 ++--- tests/Validator/ValidatorTestCase.php | 6 ++--- 26 files changed, 80 insertions(+), 80 deletions(-) diff --git a/composer.json b/composer.json index bae74db2b..2580297bf 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "dms/phpunit-arraysubset-asserts": "dev-master", "ergebnis/composer-normalize": "^2.28", "friendsofphp/php-cs-fixer": "3.64.0", - "mll-lab/php-cs-fixer-config": "^5", + "mll-lab/php-cs-fixer-config": "^5.9.2", "nyholm/psr7": "^1.5", "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", diff --git a/src/Error/CoercionError.php b/src/Error/CoercionError.php index 85bc5e209..86b14dbb2 100644 --- a/src/Error/CoercionError.php +++ b/src/Error/CoercionError.php @@ -25,7 +25,7 @@ public static function make( string $message, ?array $inputPath, $invalidValue, - ?\Throwable $previous = null, + ?\Throwable $previous = null ): self { $instance = new static($message, null, null, [], null, $previous); $instance->inputPath = $inputPath; diff --git a/src/Error/Error.php b/src/Error/Error.php index 2aa1a11e8..3491610ac 100644 --- a/src/Error/Error.php +++ b/src/Error/Error.php @@ -87,7 +87,7 @@ public function __construct( ?array $path = null, ?\Throwable $previous = null, ?array $extensions = null, - ?array $unaliasedPath = null, + ?array $unaliasedPath = null ) { parent::__construct($message, 0, $previous); diff --git a/src/Executor/ExecutionContext.php b/src/Executor/ExecutionContext.php index d33b4b11a..75f799184 100644 --- a/src/Executor/ExecutionContext.php +++ b/src/Executor/ExecutionContext.php @@ -64,7 +64,7 @@ public function __construct( array $variableValues, array $errors, callable $fieldResolver, - PromiseAdapter $promiseAdapter, + PromiseAdapter $promiseAdapter ) { $this->schema = $schema; $this->fragments = $fragments; diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index de7e95587..95a66e001 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -103,7 +103,7 @@ public static function execute( $contextValue = null, ?array $variableValues = null, ?string $operationName = null, - ?callable $fieldResolver = null, + ?callable $fieldResolver = null ): ExecutionResult { $promiseAdapter = new SyncPromiseAdapter(); @@ -143,7 +143,7 @@ public static function promiseToExecute( $contextValue = null, ?array $variableValues = null, ?string $operationName = null, - ?callable $fieldResolver = null, + ?callable $fieldResolver = null ): Promise { $executor = (self::$implementationFactory)( $promiseAdapter, diff --git a/src/Executor/ReferenceExecutor.php b/src/Executor/ReferenceExecutor.php index fc19af477..7554f1337 100644 --- a/src/Executor/ReferenceExecutor.php +++ b/src/Executor/ReferenceExecutor.php @@ -87,7 +87,7 @@ public static function create( $contextValue, array $variableValues, ?string $operationName, - callable $fieldResolver, + callable $fieldResolver ): ExecutorImplementation { $exeContext = static::buildExecutionContext( $schema, @@ -141,7 +141,7 @@ protected static function buildExecutionContext( array $rawVariableValues, ?string $operationName, callable $fieldResolver, - PromiseAdapter $promiseAdapter, + PromiseAdapter $promiseAdapter ) { /** @var array $errors */ $errors = []; @@ -394,7 +394,7 @@ protected function collectFields( ObjectType $runtimeType, SelectionSetNode $selectionSet, \ArrayObject $fields, - \ArrayObject $visitedFragmentNames, + \ArrayObject $visitedFragmentNames ): \ArrayObject { $exeContext = $this->exeContext; foreach ($selectionSet->selections as $selection) { @@ -606,7 +606,7 @@ protected function resolveField( string $responseName, array $path, array $unaliasedPath, - $contextValue, + $contextValue ) { $exeContext = $this->exeContext; @@ -723,7 +723,7 @@ protected function resolveFieldValueOrError( callable $resolveFn, $rootValue, ResolveInfo $info, - $contextValue, + $contextValue ) { try { // Build a map of arguments from the field.arguments AST, using the @@ -765,7 +765,7 @@ protected function completeValueCatchingError( array $path, array $unaliasedPath, $result, - $contextValue, + $contextValue ) { // Otherwise, error protection is applied, logging the error and resolving // a null value for this field if one is encountered. @@ -859,7 +859,7 @@ protected function completeValue( array $path, array $unaliasedPath, &$result, - $contextValue, + $contextValue ) { // If result is an Error, throw a located error. if ($result instanceof \Throwable) { @@ -1002,7 +1002,7 @@ protected function completeListValue( array $path, array $unaliasedPath, iterable &$results, - $contextValue, + $contextValue ) { $itemType = $returnType->getWrappedType(); @@ -1078,7 +1078,7 @@ protected function completeAbstractValue( array $path, array $unaliasedPath, &$result, - $contextValue, + $contextValue ) { $typeCandidate = $returnType->resolveType($result, $contextValue, $info); @@ -1211,7 +1211,7 @@ protected function completeObjectValue( array $path, array $unaliasedPath, &$result, - $contextValue, + $contextValue ) { // If there is an isTypeOf predicate function, call it with the // current result. If isTypeOf returns false, then raise an error rather @@ -1266,7 +1266,7 @@ protected function completeObjectValue( protected function invalidReturnTypeError( ObjectType $returnType, $result, - \ArrayObject $fieldNodes, + \ArrayObject $fieldNodes ): Error { $safeResult = Utils::printSafe($result); @@ -1294,7 +1294,7 @@ protected function collectAndExecuteSubfields( array $path, array $unaliasedPath, &$result, - $contextValue, + $contextValue ) { $subFieldNodes = $this->collectSubFields($returnType, $fieldNodes); @@ -1440,7 +1440,7 @@ protected function ensureValidRuntimeType( $runtimeTypeOrName, AbstractType $returnType, ResolveInfo $info, - &$result, + &$result ): ObjectType { $runtimeType = \is_string($runtimeTypeOrName) ? $this->exeContext->schema->getType($runtimeTypeOrName) diff --git a/src/GraphQL.php b/src/GraphQL.php index 9b2d65a3e..0da1e729b 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -89,7 +89,7 @@ public static function executeQuery( ?array $variableValues = null, ?string $operationName = null, ?callable $fieldResolver = null, - ?array $validationRules = null, + ?array $validationRules = null ): ExecutionResult { $promiseAdapter = new SyncPromiseAdapter(); @@ -131,7 +131,7 @@ public static function promiseToExecute( ?array $variableValues = null, ?string $operationName = null, ?callable $fieldResolver = null, - ?array $validationRules = null, + ?array $validationRules = null ): Promise { try { $documentNode = $source instanceof DocumentNode diff --git a/src/Server/Helper.php b/src/Server/Helper.php index 1e90513be..915726d0b 100644 --- a/src/Server/Helper.php +++ b/src/Server/Helper.php @@ -247,7 +247,7 @@ protected function promiseToExecuteOperation( PromiseAdapter $promiseAdapter, ServerConfig $config, OperationParams $op, - bool $isBatch = false, + bool $isBatch = false ): Promise { try { if ($config->getSchema() === null) { @@ -357,7 +357,7 @@ protected function resolveValidationRules( ServerConfig $config, OperationParams $params, DocumentNode $doc, - string $operationType, + string $operationType ): ?array { $validationRules = $config->getValidationRules(); @@ -379,7 +379,7 @@ protected function resolveRootValue( ServerConfig $config, OperationParams $params, DocumentNode $doc, - string $operationType, + string $operationType ) { $rootValue = $config->getRootValue(); @@ -395,7 +395,7 @@ protected function resolveContextValue( ServerConfig $config, OperationParams $params, DocumentNode $doc, - string $operationType, + string $operationType ) { $context = $config->getContext(); diff --git a/src/Server/StandardServer.php b/src/Server/StandardServer.php index 05a905a82..f50e6080a 100644 --- a/src/Server/StandardServer.php +++ b/src/Server/StandardServer.php @@ -139,7 +139,7 @@ public function executeRequest($parsedBody = null) public function processPsrRequest( RequestInterface $request, ResponseInterface $response, - StreamInterface $writableBodyStream, + StreamInterface $writableBodyStream ) { $result = $this->executePsrRequest($request); diff --git a/src/Type/Definition/ResolveInfo.php b/src/Type/Definition/ResolveInfo.php index 3fd87a3f2..dcae8eecf 100644 --- a/src/Type/Definition/ResolveInfo.php +++ b/src/Type/Definition/ResolveInfo.php @@ -145,7 +145,7 @@ public function __construct( $rootValue, OperationDefinitionNode $operation, array $variableValues, - array $unaliasedPath = [], + array $unaliasedPath = [] ) { $this->fieldDefinition = $fieldDefinition; $this->fieldName = $fieldDefinition->name; diff --git a/src/Utils/ASTDefinitionBuilder.php b/src/Utils/ASTDefinitionBuilder.php index 1a7bd76e5..1e5aee27c 100644 --- a/src/Utils/ASTDefinitionBuilder.php +++ b/src/Utils/ASTDefinitionBuilder.php @@ -91,7 +91,7 @@ public function __construct( array $typeDefinitionsMap, array $typeExtensionsMap, callable $resolveType, - ?callable $typeConfigDecorator = null, + ?callable $typeConfigDecorator = null ) { $this->typeDefinitionsMap = $typeDefinitionsMap; $this->typeExtensionsMap = $typeExtensionsMap; diff --git a/src/Utils/BreakingChangesFinder.php b/src/Utils/BreakingChangesFinder.php index faa2d57e8..309c6e6b6 100644 --- a/src/Utils/BreakingChangesFinder.php +++ b/src/Utils/BreakingChangesFinder.php @@ -90,7 +90,7 @@ public static function findBreakingChanges(Schema $oldSchema, Schema $newSchema) */ public static function findRemovedTypes( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -119,7 +119,7 @@ public static function findRemovedTypes( */ public static function findTypesThatChangedKind( Schema $schemaA, - Schema $schemaB, + Schema $schemaB ): array { $schemaATypeMap = $schemaA->getTypeMap(); $schemaBTypeMap = $schemaB->getTypeMap(); @@ -191,7 +191,7 @@ private static function typeKindName(NamedType $type): string */ public static function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -238,7 +238,7 @@ public static function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( private static function isChangeSafeForObjectOrInterfaceField( Type $oldType, - Type $newType, + Type $newType ): bool { if ($oldType instanceof NamedType) { return // if they're both named types, see if their names are equivalent @@ -275,7 +275,7 @@ private static function isChangeSafeForObjectOrInterfaceField( */ public static function findFieldsThatChangedTypeOnInputObjectTypes( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -350,7 +350,7 @@ public static function findFieldsThatChangedTypeOnInputObjectTypes( /** @throws InvariantViolation */ private static function isChangeSafeForInputObjectFieldOrFieldArg( Type $oldType, - Type $newType, + Type $newType ): bool { if ($oldType instanceof NamedType) { if (! $newType instanceof NamedType) { @@ -394,7 +394,7 @@ private static function isChangeSafeForInputObjectFieldOrFieldArg( */ public static function findTypesRemovedFromUnions( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -434,7 +434,7 @@ public static function findTypesRemovedFromUnions( */ public static function findValuesRemovedFromEnums( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -476,7 +476,7 @@ public static function findValuesRemovedFromEnums( */ public static function findArgChanges( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -580,7 +580,7 @@ public static function findArgChanges( */ public static function findInterfacesRemovedFromObjectTypes( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -828,7 +828,7 @@ public static function findDangerousChanges(Schema $oldSchema, Schema $newSchema */ public static function findValuesAddedToEnums( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -865,7 +865,7 @@ public static function findValuesAddedToEnums( */ public static function findInterfacesAddedToObjectTypes( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); @@ -912,7 +912,7 @@ public static function findInterfacesAddedToObjectTypes( */ public static function findTypesAddedToUnions( Schema $oldSchema, - Schema $newSchema, + Schema $newSchema ): array { $oldTypeMap = $oldSchema->getTypeMap(); $newTypeMap = $newSchema->getTypeMap(); diff --git a/src/Utils/BuildSchema.php b/src/Utils/BuildSchema.php index d2d80f3b3..dd1885891 100644 --- a/src/Utils/BuildSchema.php +++ b/src/Utils/BuildSchema.php @@ -72,7 +72,7 @@ class BuildSchema public function __construct( DocumentNode $ast, ?callable $typeConfigDecorator = null, - array $options = [], + array $options = [] ) { $this->ast = $ast; $this->typeConfigDecorator = $typeConfigDecorator; @@ -102,7 +102,7 @@ public function __construct( public static function build( $source, ?callable $typeConfigDecorator = null, - array $options = [], + array $options = [] ): Schema { $doc = $source instanceof DocumentNode ? $source @@ -135,7 +135,7 @@ public static function build( public static function buildAST( DocumentNode $ast, ?callable $typeConfigDecorator = null, - array $options = [], + array $options = [] ): Schema { return (new self($ast, $typeConfigDecorator, $options))->buildSchema(); } diff --git a/src/Utils/SchemaExtender.php b/src/Utils/SchemaExtender.php index a5f4847da..5d8b476bf 100644 --- a/src/Utils/SchemaExtender.php +++ b/src/Utils/SchemaExtender.php @@ -68,7 +68,7 @@ public static function extend( Schema $schema, DocumentNode $documentAST, array $options = [], - ?callable $typeConfigDecorator = null, + ?callable $typeConfigDecorator = null ): Schema { return (new static())->doExtend($schema, $documentAST, $options, $typeConfigDecorator); } @@ -87,7 +87,7 @@ protected function doExtend( Schema $schema, DocumentNode $documentAST, array $options = [], - ?callable $typeConfigDecorator = null, + ?callable $typeConfigDecorator = null ): Schema { if ( ! ($options['assumeValid'] ?? false) diff --git a/src/Validator/DocumentValidator.php b/src/Validator/DocumentValidator.php index 086da6ea7..98c794c70 100644 --- a/src/Validator/DocumentValidator.php +++ b/src/Validator/DocumentValidator.php @@ -98,7 +98,7 @@ public static function validate( Schema $schema, DocumentNode $ast, ?array $rules = null, - ?TypeInfo $typeInfo = null, + ?TypeInfo $typeInfo = null ): array { $rules ??= static::allRules(); @@ -268,7 +268,7 @@ public static function removeRule(ValidationRule $rule): void public static function validateSDL( DocumentNode $documentAST, ?Schema $schemaToExtend = null, - ?array $rules = null, + ?array $rules = null ): array { $rules ??= self::sdlRules(); diff --git a/src/Validator/Rules/FieldsOnCorrectType.php b/src/Validator/Rules/FieldsOnCorrectType.php index 542e790bf..38902dbbc 100644 --- a/src/Validator/Rules/FieldsOnCorrectType.php +++ b/src/Validator/Rules/FieldsOnCorrectType.php @@ -129,7 +129,7 @@ public static function undefinedFieldMessage( string $fieldName, string $type, array $suggestedTypeNames, - array $suggestedFieldNames, + array $suggestedFieldNames ): string { $message = "Cannot query field \"{$fieldName}\" on type \"{$type}\"."; diff --git a/src/Validator/Rules/KnownDirectives.php b/src/Validator/Rules/KnownDirectives.php index 32fe80280..8e692763b 100644 --- a/src/Validator/Rules/KnownDirectives.php +++ b/src/Validator/Rules/KnownDirectives.php @@ -92,7 +92,7 @@ public function getASTVisitor(ValidationContext $context): array $key, $parent, $path, - $ancestors, + $ancestors ) use ( $context, $locationsMap diff --git a/src/Validator/Rules/OverlappingFieldsCanBeMerged.php b/src/Validator/Rules/OverlappingFieldsCanBeMerged.php index a01bae09f..5b4e042c6 100644 --- a/src/Validator/Rules/OverlappingFieldsCanBeMerged.php +++ b/src/Validator/Rules/OverlappingFieldsCanBeMerged.php @@ -86,7 +86,7 @@ public function getVisitor(QueryValidationContext $context): array protected function findConflictsWithinSelectionSet( QueryValidationContext $context, ?Type $parentType, - SelectionSetNode $selectionSet, + SelectionSetNode $selectionSet ): array { [$fieldMap, $fragmentNames] = $this->getFieldsAndFragmentNames( $context, @@ -149,7 +149,7 @@ protected function findConflictsWithinSelectionSet( protected function getFieldsAndFragmentNames( QueryValidationContext $context, ?Type $parentType, - SelectionSetNode $selectionSet, + SelectionSetNode $selectionSet ): array { if (! isset($this->cachedFieldsAndFragmentNames[$selectionSet])) { /** @phpstan-var FieldMap $astAndDefs */ @@ -241,7 +241,7 @@ protected function internalCollectFieldsAndFragmentNames( ?Type $parentType, SelectionSetNode $selectionSet, array &$astAndDefs, - array &$fragmentNames, + array &$fragmentNames ): void { foreach ($selectionSet->selections as $selection) { switch (true) { @@ -295,7 +295,7 @@ protected function internalCollectFieldsAndFragmentNames( protected function collectConflictsWithin( QueryValidationContext $context, array &$conflicts, - array $fieldMap, + array $fieldMap ): void { // A field map is a keyed collection, where each key represents a response // name and the value at that key is a list of all fields which provide that @@ -343,7 +343,7 @@ protected function findConflict( bool $parentFieldsAreMutuallyExclusive, string $responseName, array $field1, - array $field2, + array $field2 ): ?array { [$parentType1, $ast1, $def1] = $field1; [$parentType2, $ast2, $def2] = $field2; @@ -516,7 +516,7 @@ protected function findConflictsBetweenSubSelectionSets( ?Type $parentType1, SelectionSetNode $selectionSet1, ?Type $parentType2, - SelectionSetNode $selectionSet2, + SelectionSetNode $selectionSet2 ): array { $conflicts = []; @@ -610,7 +610,7 @@ protected function collectConflictsBetween( array &$conflicts, bool $parentFieldsAreMutuallyExclusive, array $fieldMap1, - array $fieldMap2, + array $fieldMap2 ): void { // A field map is a keyed collection, where each key represents a response // name and the value at that key is a list of all fields which provide that @@ -659,7 +659,7 @@ protected function collectConflictsBetweenFieldsAndFragment( array &$comparedFragments, bool $areMutuallyExclusive, array $fieldMap, - string $fragmentName, + string $fragmentName ): void { if (isset($comparedFragments[$fragmentName])) { return; @@ -716,7 +716,7 @@ protected function collectConflictsBetweenFieldsAndFragment( */ protected function getReferencedFieldsAndFragmentNames( QueryValidationContext $context, - FragmentDefinitionNode $fragment, + FragmentDefinitionNode $fragment ): array { // Short-circuit building a type from the AST if possible. if (isset($this->cachedFieldsAndFragmentNames[$fragment->selectionSet])) { @@ -745,7 +745,7 @@ protected function collectConflictsBetweenFragments( array &$conflicts, bool $areMutuallyExclusive, string $fragmentName1, - string $fragmentName2, + string $fragmentName2 ): void { // No need to compare a fragment to itself. if ($fragmentName1 === $fragmentName2) { @@ -832,7 +832,7 @@ protected function subfieldConflicts( array $conflicts, string $responseName, FieldNode $ast1, - FieldNode $ast2, + FieldNode $ast2 ): ?array { if ($conflicts === []) { return null; diff --git a/src/Validator/Rules/QuerySecurityRule.php b/src/Validator/Rules/QuerySecurityRule.php index a546733c5..ce742b51b 100644 --- a/src/Validator/Rules/QuerySecurityRule.php +++ b/src/Validator/Rules/QuerySecurityRule.php @@ -104,7 +104,7 @@ protected function collectFieldASTsAndDefs( ?Type $parentType, SelectionSetNode $selectionSet, ?\ArrayObject $visitedFragmentNames = null, - ?\ArrayObject $astAndDefs = null, + ?\ArrayObject $astAndDefs = null ): \ArrayObject { $visitedFragmentNames ??= new \ArrayObject(); $astAndDefs ??= new \ArrayObject(); diff --git a/tests/Executor/Promise/SyncPromiseTest.php b/tests/Executor/Promise/SyncPromiseTest.php index 08343dc49..9a35c0fd0 100644 --- a/tests/Executor/Promise/SyncPromiseTest.php +++ b/tests/Executor/Promise/SyncPromiseTest.php @@ -42,7 +42,7 @@ public function testFulfilledPromiseCannotChangeValue( ?callable $onFulfilled, ?string $expectedNextValue, ?string $expectedNextReason, - ?string $expectedNextState, + ?string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); @@ -61,7 +61,7 @@ public function testFulfilledPromiseCannotBeRejected( ?callable $onFulfilled, ?string $expectedNextValue, ?string $expectedNextReason, - ?string $expectedNextState, + ?string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); @@ -84,7 +84,7 @@ public function testFulfilledPromise( ?callable $onFulfilled, $expectedNextValue, ?string $expectedNextReason, - ?string $expectedNextState, + ?string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); @@ -139,7 +139,7 @@ private static function assertValidPromise( SyncPromise $promise, $expectedNextValue, ?string $expectedNextReason, - ?string $expectedNextState, + ?string $expectedNextState ): void { $actualNextValue = null; $actualNextReason = null; @@ -204,7 +204,7 @@ public function testRejectedPromiseCannotChangeReason( ?callable $onRejected, ?string $expectedNextValue, ?string $expectedNextReason, - string $expectedNextState, + string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); @@ -223,7 +223,7 @@ public function testRejectedPromiseCannotBeResolved( ?callable $onRejected, ?string $expectedNextValue, ?string $expectedNextReason, - string $expectedNextState, + string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); @@ -242,7 +242,7 @@ public function testRejectedPromise( ?callable $onRejected, ?string $expectedNextValue, ?string $expectedNextReason, - string $expectedNextState, + string $expectedNextState ): void { $promise = new SyncPromise(); self::assertSame(SyncPromise::PENDING, $promise->state); diff --git a/tests/Executor/UnionInterfaceTest.php b/tests/Executor/UnionInterfaceTest.php index 7d7994077..968cdac1e 100644 --- a/tests/Executor/UnionInterfaceTest.php +++ b/tests/Executor/UnionInterfaceTest.php @@ -526,7 +526,7 @@ public function testGetsExecutionInfoInResolver(): void 'resolveType' => static function ( $obj, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$encounteredContext, &$encounteredSchema, diff --git a/tests/Language/ParserTest.php b/tests/Language/ParserTest.php index e2b4492f6..bc4056cd9 100644 --- a/tests/Language/ParserTest.php +++ b/tests/Language/ParserTest.php @@ -76,7 +76,7 @@ public function testParseProvidesUsefulErrors( string $expectedMessage, string $stringRepresentation, ?array $expectedPositions = null, - ?array $expectedLocations = null, + ?array $expectedLocations = null ): void { try { Parser::parse($str); diff --git a/tests/Server/RequestParsingTest.php b/tests/Server/RequestParsingTest.php index 31ddb6b18..cf3779049 100644 --- a/tests/Server/RequestParsingTest.php +++ b/tests/Server/RequestParsingTest.php @@ -77,7 +77,7 @@ private static function assertValidOperationParams( $variables = null, ?string $operation = null, ?array $extensions = null, - string $message = '', + string $message = '' ): void { self::assertSame($query, $params->query, $message); self::assertSame($queryId, $params->queryId, $message); diff --git a/tests/Type/QueryPlanTest.php b/tests/Type/QueryPlanTest.php index c35e79f9d..01410e519 100644 --- a/tests/Type/QueryPlanTest.php +++ b/tests/Type/QueryPlanTest.php @@ -746,7 +746,7 @@ public function testMergedFragmentsQueryPlan(): void $value, array $args, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$hasCalled, &$queryPlan @@ -1061,7 +1061,7 @@ public function testQueryPlanForMultipleFieldNodes(): void $value, array $args, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$hasCalled, &$queryPlan diff --git a/tests/Type/ResolveInfoTest.php b/tests/Type/ResolveInfoTest.php index 16a9201fb..050888020 100644 --- a/tests/Type/ResolveInfoTest.php +++ b/tests/Type/ResolveInfoTest.php @@ -153,7 +153,7 @@ public function testFieldSelection(): void $value, array $args, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$actualDefaultSelection, &$actualDeepSelection @@ -349,7 +349,7 @@ public function testMergedFragmentsFieldSelection(): void $value, array $args, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$hasCalled, &$actualDeepSelection @@ -401,7 +401,7 @@ public function testDeepFieldSelectionOnDuplicatedFields(): void $value, array $args, $context, - ResolveInfo $info, + ResolveInfo $info ) use ( &$hasCalled, &$actualDeepSelection diff --git a/tests/Validator/ValidatorTestCase.php b/tests/Validator/ValidatorTestCase.php index 3efb34fa3..28e48d2ec 100644 --- a/tests/Validator/ValidatorTestCase.php +++ b/tests/Validator/ValidatorTestCase.php @@ -438,7 +438,7 @@ protected function expectFailsRule( ValidationRule $rule, string $queryString, array $errors, - array $options = [], + array $options = [] ): array { return $this->expectInvalid(self::getTestSchema(), [$rule], $queryString, $errors, $options); } @@ -487,7 +487,7 @@ protected function expectFailsRuleWithSchema( Schema $schema, ValidationRule $rule, string $queryString, - array $errors, + array $errors ): void { $this->expectInvalid($schema, [$rule], $queryString, $errors); } @@ -527,7 +527,7 @@ protected function expectSDLErrorsFromRule( ValidationRule $rule, string $sdlString, ?Schema $schema = null, - array $errors = [], + array $errors = [] ): void { $actualErrors = DocumentValidator::validateSDL(Parser::parse($sdlString), $schema, [$rule]); self::assertEquals(