Skip to content

Commit 1aec375

Browse files
spawniagithub-actions[bot]
authored andcommitted
Apply php-cs-fixer changes
1 parent 0d57fa5 commit 1aec375

33 files changed

+116
-1
lines changed

src/Error/Warning.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @phpstan-type WarningHandler callable(string $errorMessage, int $warningId, ?int $messageLevel): void
2121
*
2222
* @see https://github.com/vimeo/psalm/issues/7527
23+
*
2324
* @psalm-type WarningHandler callable(string, int, int|null): void
2425
*/
2526
final class Warning
@@ -39,6 +40,7 @@ final class Warning
3940

4041
/**
4142
* @var callable|null
43+
*
4244
* @phpstan-var WarningHandler|null
4345
*/
4446
private static $warningHandler;

src/Executor/ExecutionContext.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ExecutionContext
3636

3737
/**
3838
* @var callable
39+
*
3940
* @phpstan-var FieldResolver
4041
*/
4142
public $fieldResolver;
@@ -51,6 +52,7 @@ class ExecutionContext
5152
* @param mixed $contextValue
5253
* @param array<string, mixed> $variableValues
5354
* @param array<int, Error> $errors
55+
*
5456
* @phpstan-param FieldResolver $fieldResolver
5557
*/
5658
public function __construct(

src/Executor/ExecutionResult.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* @phpstan-type ErrorsHandler callable(array<Error> $errors, ErrorFormatter $formatter): SerializableErrors
3939
*
4040
* @see https://github.com/vimeo/psalm/issues/6928
41+
*
4142
* @psalm-type ErrorsHandler callable(Error[], ErrorFormatter): SerializableErrors
4243
*/
4344
class ExecutionResult implements JsonSerializable
@@ -74,12 +75,14 @@ class ExecutionResult implements JsonSerializable
7475

7576
/**
7677
* @var callable|null
78+
*
7779
* @phpstan-var ErrorFormatter|null
7880
*/
7981
private $errorFormatter = null;
8082

8183
/**
8284
* @var callable|null
85+
*
8386
* @phpstan-var ErrorsHandler|null
8487
*/
8588
private $errorsHandler = null;

src/Executor/Executor.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@
2020
* @phpstan-type FieldResolver callable(mixed, array<string, mixed>, mixed, ResolveInfo): mixed
2121
*
2222
* @see https://github.com/vimeo/psalm/issues/6928
23+
*
2324
* @psalm-type FieldResolver callable(mixed, array, mixed, ResolveInfo): mixed
25+
*
2426
* @phpstan-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array<mixed>, ?string, callable): ExecutorImplementation
2527
*
2628
* @see https://github.com/vimeo/psalm/issues/6928, https://github.com/vimeo/psalm/issues/7527
29+
*
2730
* @psalm-type ImplementationFactory callable(PromiseAdapter, Schema, DocumentNode, mixed, mixed, array, ?string, callable): ExecutorImplementation
2831
*/
2932
class Executor
3033
{
3134
/**
3235
* @var callable
36+
*
3337
* @phpstan-var FieldResolver
3438
*/
3539
private static $defaultFieldResolver = [self::class, 'defaultFieldResolver'];
@@ -38,6 +42,7 @@ class Executor
3842

3943
/**
4044
* @var callable
45+
*
4146
* @phpstan-var ImplementationFactory
4247
*/
4348
private static $implementationFactory = [ReferenceExecutor::class, 'create'];
@@ -100,6 +105,7 @@ public static function setImplementationFactory(callable $implementationFactory)
100105
* @param mixed $rootValue
101106
* @param mixed $contextValue
102107
* @param array<string, mixed>|null $variableValues
108+
*
103109
* @phpstan-param FieldResolver|null $fieldResolver
104110
*
105111
* @api
@@ -138,6 +144,7 @@ public static function execute(
138144
* @param mixed $rootValue
139145
* @param mixed $contextValue
140146
* @param array<string, mixed>|null $variableValues
147+
*
141148
* @phpstan-param FieldResolver|null $fieldResolver
142149
*
143150
* @api

src/Executor/ReferenceExecutor.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
/**
6161
* @phpstan-import-type FieldResolver from Executor
6262
* @phpstan-import-type Path from ResolveInfo
63+
*
6364
* @phpstan-type Fields ArrayObject<string, ArrayObject<int, FieldNode>>
6465
*/
6566
class ReferenceExecutor implements ExecutorImplementation
@@ -96,6 +97,7 @@ protected function __construct(ExecutionContext $context)
9697
* @param mixed $rootValue
9798
* @param mixed $contextValue
9899
* @param array<string, mixed> $variableValues
100+
*
99101
* @phpstan-param FieldResolver $fieldResolver
100102
*/
101103
public static function create(
@@ -145,6 +147,7 @@ public function doExecute(): Promise
145147
* @param mixed $rootValue
146148
* @param mixed $contextValue
147149
* @param array<string, mixed> $rawVariableValues
150+
*
148151
* @phpstan-param FieldResolver $fieldResolver
149152
*
150153
* @return ExecutionContext|array<int, Error>
@@ -391,6 +394,7 @@ protected function getOperationRootType(Schema $schema, OperationDefinitionNode
391394
* Object type returned by that field.
392395
*
393396
* @param ArrayObject<string, true> $visitedFragmentNames
397+
*
394398
* @phpstan-param Fields $fields
395399
*
396400
* @phpstan-return Fields
@@ -525,6 +529,7 @@ protected function doesFragmentConditionMatch(Node $fragment, ObjectType $type):
525529
*
526530
* @param mixed $rootValue
527531
* @param array<string|int> $path
532+
*
528533
* @phpstan-param Fields $fields
529534
*
530535
* @return array<mixed>|Promise|stdClass
@@ -579,6 +584,7 @@ function ($results, $responseName) use ($path, $parentType, $rootValue, $fields)
579584
*
580585
* @param mixed $rootValue
581586
* @param array<int, string|int> $path
587+
*
582588
* @phpstan-param Path $path
583589
*
584590
* @param ArrayObject<int, FieldNode> $fieldNodes
@@ -680,6 +686,7 @@ protected function getFieldDef(Schema $schema, ObjectType $parentType, string $f
680686
* Returns the result of resolveFn or the abrupt-return Error object.
681687
*
682688
* @param mixed $rootValue
689+
*
683690
* @phpstan-param FieldResolver $resolveFn
684691
*
685692
* @return Throwable|Promise|mixed
@@ -713,6 +720,7 @@ protected function resolveFieldValueOrError(
713720
*
714721
* @param ArrayObject<int, FieldNode> $fieldNodes
715722
* @param array<string|int> $path
723+
*
716724
* @phpstan-param Path $path
717725
*
718726
* @param mixed $result
@@ -1270,6 +1278,7 @@ protected function collectSubFields(ObjectType $returnType, ArrayObject $fieldNo
12701278
*
12711279
* @param mixed $rootValue
12721280
* @param array<string|int> $path
1281+
*
12731282
* @phpstan-param Fields $fields
12741283
*
12751284
* @return Promise|stdClass|array<mixed>

src/Language/AST/NodeList.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121

2222
/**
2323
* @template T of Node
24+
*
2425
* @phpstan-implements ArrayAccess<array-key, T>
2526
* @phpstan-implements IteratorAggregate<array-key, T>
2627
*/
2728
class NodeList implements ArrayAccess, IteratorAggregate, Countable
2829
{
2930
/**
3031
* @var array<Node|array>
32+
*
3133
* @phpstan-var array<T|array<string, mixed>>
3234
*/
3335
private $nodes;
@@ -36,6 +38,7 @@ class NodeList implements ArrayAccess, IteratorAggregate, Countable
3638
* @template TT of Node
3739
*
3840
* @param array<Node|array<string, mixed>> $nodes
41+
*
3942
* @phpstan-param array<TT|array<string, mixed>> $nodes
4043
*
4144
* @phpstan-return self<TT>
@@ -47,6 +50,7 @@ public static function create(array $nodes): self
4750

4851
/**
4952
* @param array<Node|array> $nodes
53+
*
5054
* @phpstan-param array<T|array<string, mixed>> $nodes
5155
*/
5256
public function __construct(array $nodes)
@@ -84,6 +88,7 @@ public function offsetGet($offset): Node
8488
/**
8589
* @param int|string|null $offset
8690
* @param Node|array<string, mixed> $value
91+
*
8792
* @phpstan-param T|array<string, mixed> $value
8893
*/
8994
#[ReturnTypeWillChange]

src/Language/Parser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ class Parser
181181
* Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered.
182182
*
183183
* @param Source|string $source
184+
*
184185
* @phpstan-param ParserOptions $options
185186
*
186187
* @throws SyntaxError
@@ -203,6 +204,7 @@ public static function parse($source, array $options = []): DocumentNode
203204
* Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`.
204205
*
205206
* @param Source|string $source
207+
*
206208
* @phpstan-param ParserOptions $options
207209
*
208210
* @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode|VariableNode
@@ -230,6 +232,7 @@ public static function parseValue($source, array $options = [])
230232
* Consider providing the results to the utility function: `GraphQL\Utils\AST::typeFromAST()`.
231233
*
232234
* @param Source|string $source
235+
*
233236
* @phpstan-param ParserOptions $options
234237
*
235238
* @return ListTypeNode|NamedTypeNode|NonNullTypeNode
@@ -304,6 +307,7 @@ public static function __callStatic(string $name, array $arguments)
304307

305308
/**
306309
* @param Source|string $source
310+
*
307311
* @phpstan-param ParserOptions $options
308312
*/
309313
public function __construct($source, array $options = [])

src/Server/ServerConfig.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* @phpstan-type PersistedQueryLoader callable(string $queryId, OperationParams $operation): (string|DocumentNode)
3333
* @phpstan-type RootValueResolver callable(OperationParams $operation, DocumentNode $doc, string $operationType): mixed
3434
* @phpstan-type ValidationRulesOption array<ValidationRule>|null|callable(OperationParams $operation, DocumentNode $doc, string $operationType): array<ValidationRule>
35+
*
3536
* @phpstan-import-type ErrorsHandler from ExecutionResult
3637
* @phpstan-import-type ErrorFormatter from ExecutionResult
3738
*/
@@ -98,18 +99,21 @@ public static function create(array $config = []): self
9899

99100
/**
100101
* @var mixed|callable
102+
*
101103
* @phpstan-var mixed|RootValueResolver
102104
*/
103105
private $rootValue = null;
104106

105107
/**
106108
* @var callable|null
109+
*
107110
* @phpstan-var ErrorFormatter|null
108111
*/
109112
private $errorFormatter = null;
110113

111114
/**
112115
* @var callable|null
116+
*
113117
* @phpstan-var ErrorsHandler|null
114118
*/
115119
private $errorsHandler = null;
@@ -120,6 +124,7 @@ public static function create(array $config = []): self
120124

121125
/**
122126
* @var array<ValidationRule>|callable|null
127+
*
123128
* @phpstan-var ValidationRulesOption
124129
*/
125130
private $validationRules = null;
@@ -131,6 +136,7 @@ public static function create(array $config = []): self
131136

132137
/**
133138
* @var callable|null
139+
*
134140
* @phpstan-var PersistedQueryLoader|null
135141
*/
136142
private $persistedQueryLoader = null;
@@ -159,6 +165,7 @@ public function setContext($context): self
159165

160166
/**
161167
* @param mixed|callable $rootValue
168+
*
162169
* @phpstan-param mixed|RootValueResolver $rootValue
163170
*
164171
* @api
@@ -198,6 +205,7 @@ public function setErrorsHandler(callable $handler): self
198205
* Set validation rules for this server.
199206
*
200207
* @param array<ValidationRule>|callable|null $validationRules
208+
*
201209
* @phpstan-param ValidationRulesOption $validationRules
202210
*
203211
* @api
@@ -284,6 +292,7 @@ public function getContext()
284292

285293
/**
286294
* @return mixed|callable
295+
*
287296
* @phpstan-return mixed|RootValueResolver
288297
*/
289298
public function getRootValue()
@@ -319,6 +328,7 @@ public function getPromiseAdapter(): ?PromiseAdapter
319328

320329
/**
321330
* @return array<ValidationRule>|callable|null
331+
*
322332
* @phpstan-return ValidationRulesOption
323333
*/
324334
public function getValidationRules()

src/Type/Definition/AbstractType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface AbstractType
1717
* @param mixed $context The context that was passed to GraphQL::execute()
1818
*
1919
* @return ObjectType|string|callable|Deferred|null
20+
*
2021
* @phpstan-return ResolveTypeReturn
2122
*/
2223
public function resolveType($objectValue, $context, ResolveInfo $info);

src/Type/Definition/CustomScalarType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class CustomScalarType extends ScalarType
4040

4141
/**
4242
* @param array<string, mixed> $config
43+
*
4344
* @phpstan-param CustomScalarConfig $config
4445
*/
4546
public function __construct(array $config)

0 commit comments

Comments
 (0)