66
77use GraphQL \Type \Definition \InputType ;
88use GraphQL \Type \Definition \ResolveInfo ;
9+ use GraphQL \Type \Definition \Type ;
910use Symfony \Component \Validator \Constraint ;
1011use Symfony \Component \Validator \ConstraintValidatorFactoryInterface ;
1112use Symfony \Component \Validator \Context \ExecutionContext ;
@@ -29,9 +30,7 @@ class ParameterValidator implements InputTypeParameterInterface
2930 /** @var TranslatorInterface */
3031 private $ translator ;
3132
32- /**
33- * @param Constraint[] $constraints
34- */
33+ /** @param Constraint[] $constraints */
3534 public function __construct (InputTypeParameterInterface $ parameter , string $ parameterName , array $ constraints , ConstraintValidatorFactoryInterface $ constraintValidatorFactory , ValidatorInterface $ validator , TranslatorInterface $ translator )
3635 {
3736 $ this ->parameter = $ parameter ;
@@ -42,13 +41,8 @@ public function __construct(InputTypeParameterInterface $parameter, string $para
4241 $ this ->translator = $ translator ;
4342 }
4443
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
5246 {
5347 $ value = $ this ->parameter ->resolve ($ source , $ args , $ context , $ info );
5448
@@ -69,7 +63,7 @@ public function resolve(?object $source, array $args, $context, ResolveInfo $inf
6963 return $ value ;
7064 }
7165
72- public function getType (): InputType
66+ public function getType (): InputType & Type
7367 {
7468 return $ this ->parameter ->getType ();
7569 }
@@ -79,10 +73,7 @@ public function hasDefaultValue(): bool
7973 return $ this ->parameter ->hasDefaultValue ();
8074 }
8175
82- /**
83- * @return mixed
84- */
85- public function getDefaultValue ()
76+ public function getDefaultValue (): mixed
8677 {
8778 return $ this ->parameter ->getDefaultValue ();
8879 }
0 commit comments