diff --git a/docs/class-reference.md b/docs/class-reference.md index 8b050101c..9c7a9f6d4 100644 --- a/docs/class-reference.md +++ b/docs/class-reference.md @@ -1424,14 +1424,14 @@ locations?: array, path?: array, extensions?: array } -@phpstan-type SerializableErrors array +@phpstan-type SerializableErrors list @phpstan-type SerializableResult array{ data?: array, errors?: SerializableErrors, extensions?: array } @phpstan-type ErrorFormatter callable(\Throwable): SerializableError -@phpstan-type ErrorsHandler callable(array $errors, ErrorFormatter $formatter): SerializableErrors +@phpstan-type ErrorsHandler callable(list $errors, ErrorFormatter $formatter): SerializableErrors @see \GraphQL\Tests\Executor\ExecutionResultTest @@ -1455,7 +1455,7 @@ public $data; * * @api * - * @var array + * @var list */ public $errors; @@ -1642,7 +1642,7 @@ will be created from the provided schema. * * @throws \Exception * - * @return array + * @return list * * @api */ diff --git a/src/Executor/ExecutionResult.php b/src/Executor/ExecutionResult.php index 89acbce09..f48a53d0d 100644 --- a/src/Executor/ExecutionResult.php +++ b/src/Executor/ExecutionResult.php @@ -20,14 +20,14 @@ * path?: array, * extensions?: array * } - * @phpstan-type SerializableErrors array + * @phpstan-type SerializableErrors list * @phpstan-type SerializableResult array{ * data?: array, * errors?: SerializableErrors, * extensions?: array * } * @phpstan-type ErrorFormatter callable(\Throwable): SerializableError - * @phpstan-type ErrorsHandler callable(array $errors, ErrorFormatter $formatter): SerializableErrors + * @phpstan-type ErrorsHandler callable(list $errors, ErrorFormatter $formatter): SerializableErrors * * @see \GraphQL\Tests\Executor\ExecutionResultTest */ @@ -50,7 +50,7 @@ class ExecutionResult implements \JsonSerializable * * @api * - * @var array + * @var list */ public array $errors = []; @@ -79,7 +79,7 @@ class ExecutionResult implements \JsonSerializable /** * @param array|null $data - * @param array $errors + * @param list $errors * @param array $extensions */ public function __construct(?array $data = null, array $errors = [], array $extensions = []) diff --git a/src/Type/SchemaValidationContext.php b/src/Type/SchemaValidationContext.php index ea55e3874..acbd16b04 100644 --- a/src/Type/SchemaValidationContext.php +++ b/src/Type/SchemaValidationContext.php @@ -47,7 +47,7 @@ class SchemaValidationContext { - /** @var array */ + /** @var list */ private array $errors = []; private Schema $schema; @@ -60,7 +60,7 @@ public function __construct(Schema $schema) $this->inputObjectCircularRefs = new InputObjectCircularRefs($this); } - /** @return array */ + /** @return list */ public function getErrors(): array { return $this->errors; diff --git a/src/Validator/DocumentValidator.php b/src/Validator/DocumentValidator.php index 98c794c70..59ea46846 100644 --- a/src/Validator/DocumentValidator.php +++ b/src/Validator/DocumentValidator.php @@ -90,7 +90,7 @@ class DocumentValidator * * @throws \Exception * - * @return array + * @return list * * @api */ @@ -263,7 +263,7 @@ public static function removeRule(ValidationRule $rule): void * * @throws \Exception * - * @return array + * @return list */ public static function validateSDL( DocumentNode $documentAST, diff --git a/src/Validator/QueryValidationContext.php b/src/Validator/QueryValidationContext.php index 96a6166bc..0fe5f6ffc 100644 --- a/src/Validator/QueryValidationContext.php +++ b/src/Validator/QueryValidationContext.php @@ -36,7 +36,7 @@ class QueryValidationContext implements ValidationContext protected DocumentNode $ast; - /** @var array */ + /** @var list */ protected array $errors = []; private TypeInfo $typeInfo; @@ -73,7 +73,7 @@ public function reportError(Error $error): void $this->errors[] = $error; } - /** @return array */ + /** @return list */ public function getErrors(): array { return $this->errors; diff --git a/src/Validator/ValidationContext.php b/src/Validator/ValidationContext.php index 7abeee6be..9947dbf66 100644 --- a/src/Validator/ValidationContext.php +++ b/src/Validator/ValidationContext.php @@ -10,7 +10,7 @@ interface ValidationContext { public function reportError(Error $error): void; - /** @return array */ + /** @return list */ public function getErrors(): array; public function getDocument(): DocumentNode;