6
6
7
7
use GraphQL \Type \Definition \InputType ;
8
8
use GraphQL \Type \Definition \ResolveInfo ;
9
+ use GraphQL \Type \Definition \Type ;
9
10
use Symfony \Component \Validator \Constraint ;
10
11
use Symfony \Component \Validator \ConstraintValidatorFactoryInterface ;
11
12
use Symfony \Component \Validator \Context \ExecutionContext ;
@@ -29,9 +30,7 @@ class ParameterValidator implements InputTypeParameterInterface
29
30
/** @var TranslatorInterface */
30
31
private $ translator ;
31
32
32
- /**
33
- * @param Constraint[] $constraints
34
- */
33
+ /** @param Constraint[] $constraints */
35
34
public function __construct (InputTypeParameterInterface $ parameter , string $ parameterName , array $ constraints , ConstraintValidatorFactoryInterface $ constraintValidatorFactory , ValidatorInterface $ validator , TranslatorInterface $ translator )
36
35
{
37
36
$ this ->parameter = $ parameter ;
@@ -42,13 +41,8 @@ public function __construct(InputTypeParameterInterface $parameter, string $para
42
41
$ this ->translator = $ translator ;
43
42
}
44
43
45
- /**
46
- * @param array<string, mixed> $args
47
- * @param mixed $context
48
- *
49
- * @return mixed
50
- */
51
- public function resolve (?object $ source , array $ args , $ context , ResolveInfo $ info )
44
+ /** @param array<string, mixed> $args */
45
+ public function resolve (object |null $ source , array $ args , mixed $ context , ResolveInfo $ info ): mixed
52
46
{
53
47
$ value = $ this ->parameter ->resolve ($ source , $ args , $ context , $ info );
54
48
@@ -69,7 +63,7 @@ public function resolve(?object $source, array $args, $context, ResolveInfo $inf
69
63
return $ value ;
70
64
}
71
65
72
- public function getType (): InputType
66
+ public function getType (): InputType & Type
73
67
{
74
68
return $ this ->parameter ->getType ();
75
69
}
@@ -79,10 +73,7 @@ public function hasDefaultValue(): bool
79
73
return $ this ->parameter ->hasDefaultValue ();
80
74
}
81
75
82
- /**
83
- * @return mixed
84
- */
85
- public function getDefaultValue ()
76
+ public function getDefaultValue (): mixed
86
77
{
87
78
return $ this ->parameter ->getDefaultValue ();
88
79
}
0 commit comments