Skip to content

Commit

Permalink
Left-align PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Jun 10, 2024
1 parent 9cd6441 commit 91bd9e2
Show file tree
Hide file tree
Showing 30 changed files with 109 additions and 106 deletions.
3 changes: 3 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'phpdoc_align' => [
'align' => 'left'
],
'phpdoc_order_by_value' => [
'annotations' => [
'throws',
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Utils/SchemaGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ protected function createFieldArgs(string $fieldName, string $typeName): array
}

/**
* @param mixed $root
* @param mixed $root
* @param array<string, mixed> $args
* @param mixed $context
* @param mixed $context
*/
public function resolveField($root, array $args, $context, ResolveInfo $resolveInfo): string
{
Expand Down
16 changes: 8 additions & 8 deletions docs/class-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ See [related documentation](executing-queries.md).
* Empty array would allow to skip query validation (may be convenient for persisted
* queries which are validated before persisting and assumed valid during execution)
*
* @param string|DocumentNode $source
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
* @param string|DocumentNode $source
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
* @param array<ValidationRule>|null $validationRules
*
* @api
Expand Down Expand Up @@ -1355,8 +1355,8 @@ Implements the "Evaluating requests" section of the GraphQL specification.
* Always returns ExecutionResult and never throws.
* All errors which occur during operation execution are collected in `$result->errors`.
*
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
*
* @phpstan-param FieldResolver|null $fieldResolver
Expand All @@ -1383,8 +1383,8 @@ static function execute(
*
* Useful for async PHP platforms.
*
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
*
* @phpstan-param FieldResolver|null $fieldResolver
Expand Down
2 changes: 1 addition & 1 deletion generate-class-reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
];

/**
* @param ReflectionClass<object> $class
* @param ReflectionClass<object> $class
* @param array{constants?: bool, props?: bool, methods?: bool} $options
*
* @throws ExceptionInterface
Expand Down
18 changes: 9 additions & 9 deletions src/Error/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class Error extends \Exception implements \JsonSerializable, ClientAware, Provid

/**
* @param iterable<array-key, Node|null>|Node|null $nodes
* @param array<int, int>|null $positions
* @param list<int|string>|null $path
* @param array<string, mixed>|null $extensions
* @param list<int|string>|null $unaliasedPath
* @param array<int, int>|null $positions
* @param list<int|string>|null $path
* @param array<string, mixed>|null $extensions
* @param list<int|string>|null $unaliasedPath
*/
public function __construct(
string $message = '',
Expand Down Expand Up @@ -125,10 +125,10 @@ public function __construct(
* GraphQL operation, produce a new GraphQLError aware of the location in the
* document responsible for the original Error.
*
* @param mixed $error
* @param iterable<Node>|Node|null $nodes
* @param list<int|string>|null $path
* @param list<int|string>|null $unaliasedPath
* @param mixed $error
* @param iterable<Node>|Node|null $nodes
* @param list<int|string>|null $path
* @param list<int|string>|null $unaliasedPath
*/
public static function createLocatedError($error, $nodes = null, ?array $path = null, ?array $unaliasedPath = null): Error
{
Expand Down Expand Up @@ -303,7 +303,7 @@ public function getExtensions(): ?array
* @see http://php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return array<string, mixed> data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource
* which is a value of any type other than a resource
*/
#[\ReturnTypeWillChange]
public function jsonSerialize(): array
Expand Down
8 changes: 4 additions & 4 deletions src/Executor/ExecutionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ class ExecutionContext

/**
* @param array<string, FragmentDefinitionNode> $fragments
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed> $variableValues
* @param array<int, Error> $errors
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed> $variableValues
* @param array<int, Error> $errors
*
* @phpstan-param FieldResolver $fieldResolver
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Executor/ExecutionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class ExecutionResult implements \JsonSerializable

/**
* @param array<string, mixed>|null $data
* @param array<Error> $errors
* @param array<string, mixed> $extensions
* @param array<Error> $errors
* @param array<string, mixed> $extensions
*/
public function __construct(?array $data = null, array $errors = [], array $extensions = [])
{
Expand Down
8 changes: 4 additions & 4 deletions src/Executor/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public static function setImplementationFactory(callable $implementationFactory)
* Always returns ExecutionResult and never throws.
* All errors which occur during operation execution are collected in `$result->errors`.
*
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
*
* @phpstan-param FieldResolver|null $fieldResolver
Expand Down Expand Up @@ -127,8 +127,8 @@ public static function execute(
*
* Useful for async PHP platforms.
*
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
*
* @phpstan-param FieldResolver|null $fieldResolver
Expand Down
70 changes: 35 additions & 35 deletions src/Executor/ReferenceExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public function doExecute(): Promise
* Constructs an ExecutionContext object from the arguments passed to
* execute, which we will pass throughout the other execution methods.
*
* @param mixed $rootValue
* @param mixed $contextValue
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed> $rawVariableValues
*
* @phpstan-param FieldResolver $fieldResolver
Expand Down Expand Up @@ -521,10 +521,10 @@ protected function doesFragmentConditionMatch(Node $fragment, ObjectType $type):
/**
* Implements the "Evaluating selection sets" section of the spec for "write" mode.
*
* @param mixed $rootValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
* @param mixed $rootValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
*
* @phpstan-param Fields $fields
*
Expand Down Expand Up @@ -585,10 +585,10 @@ function ($results, $responseName) use ($contextValue, $path, $unaliasedPath, $p
* by calling its resolve function, then calls completeValue to complete promises,
* serialize scalars, or execute the sub-selection-set for objects.
*
* @param mixed $rootValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
* @param mixed $rootValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
*
* @phpstan-param Path $path
* @phpstan-param Path $unaliasedPath
Expand Down Expand Up @@ -735,14 +735,14 @@ protected function resolveFieldValueOrError(
* in the execution context.
*
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
*
* @phpstan-param Path $path
* @phpstan-param Path $unaliasedPath
*
* @param mixed $result
* @param mixed $result
*
* @throws Error
*
Expand Down Expand Up @@ -785,10 +785,10 @@ protected function completeValueCatchingError(
}

/**
* @param mixed $rawError
* @param mixed $rawError
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
*
* @throws Error
*/
Expand Down Expand Up @@ -834,10 +834,10 @@ protected function handleFieldError($rawError, \ArrayObject $fieldNodes, array $
* value by evaluating all sub-selections.
*
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
*
* @throws \Throwable
* @throws Error
Expand Down Expand Up @@ -952,7 +952,7 @@ protected function getPromise($value): ?Promise
* If the callback does not return a Promise, then this function will also not
* return a Promise.
*
* @param array<mixed> $values
* @param array<mixed> $values
* @param Promise|mixed|null $initialValue
*
* @return Promise|mixed|null
Expand Down Expand Up @@ -981,7 +981,7 @@ function ($previous, $value) use ($callback) {
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param iterable<mixed> $results
* @param mixed $contextValue
* @param mixed $contextValue
*
* @throws Error
*
Expand Down Expand Up @@ -1186,10 +1186,10 @@ protected function defaultTypeResolver($value, $contextValue, ResolveInfo $info,
* Complete an Object value by executing all sub-selections.
*
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
*
* @throws \Exception
* @throws Error
Expand Down Expand Up @@ -1253,7 +1253,7 @@ protected function completeObjectValue(

/**
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param array<mixed> $result
* @param array<mixed> $result
*/
protected function invalidReturnTypeError(
ObjectType $returnType,
Expand All @@ -1270,10 +1270,10 @@ protected function invalidReturnTypeError(

/**
* @param \ArrayObject<int, FieldNode> $fieldNodes
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $result
* @param mixed $contextValue
*
* @throws \Exception
* @throws Error
Expand Down Expand Up @@ -1333,10 +1333,10 @@ protected function collectSubFields(ObjectType $returnType, \ArrayObject $fieldN
/**
* Implements the "Evaluating selection sets" section of the spec for "read" mode.
*
* @param mixed $rootValue
* @param mixed $rootValue
* @param list<string|int> $path
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
* @param list<string|int> $unaliasedPath
* @param mixed $contextValue
*
* @phpstan-param Fields $fields
*
Expand Down
8 changes: 4 additions & 4 deletions src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class GraphQL
* Empty array would allow to skip query validation (may be convenient for persisted
* queries which are validated before persisting and assumed valid during execution)
*
* @param string|DocumentNode $source
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
* @param string|DocumentNode $source
* @param mixed $rootValue
* @param mixed $contextValue
* @param array<string, mixed>|null $variableValues
* @param array<ValidationRule>|null $validationRules
*
* @api
Expand Down
2 changes: 1 addition & 1 deletion src/Language/AST/NodeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function offsetGet($offset): Node
}

/**
* @param int|string|null $offset
* @param int|string|null $offset
* @param Node|array<string, mixed> $value
*
* @phpstan-param T|array<string, mixed> $value
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Definition/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static function assertObjectType($type): self

/**
* @param mixed $objectValue The resolved value for the object type
* @param mixed $context The context that was passed to GraphQL::execute()
* @param mixed $context The context that was passed to GraphQL::execute()
*
* @return bool|Deferred|null
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/BuildClientSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BuildClientSchema

/**
* @param array<string, mixed> $introspectionQuery
* @param array<string, bool> $options
* @param array<string, bool> $options
*
* @phpstan-param Options $options
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/InterfaceImplementations.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class InterfaceImplementations
private $interfaces;

/**
* @param array<int, ObjectType> $objects
* @param array<int, ObjectType> $objects
* @param array<int, InterfaceType> $interfaces
*/
public function __construct(array $objects, array $interfaces)
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/MixedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function offsetGet($offset)
}

/**
* @param mixed $offset
* @param mixed $offset
* @param TValue $value
*
* @throws \InvalidArgumentException
Expand Down
Loading

0 comments on commit 91bd9e2

Please sign in to comment.