| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | abstract class AbstractResolver implements ResolverInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @return mixed |
||
| 11 | */ |
||
| 12 | public function __invoke() |
||
| 13 | { |
||
| 14 | return $this->resolve(...\func_get_args()); |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param mixed $rootValue |
||
| 19 | * @param array $args |
||
| 20 | * @param mixed $contextValues |
||
| 21 | * @param ResolveInfo|null $info |
||
| 22 | * @return mixed |
||
| 23 | */ |
||
| 24 | abstract public function resolve($rootValue, array $args, $contextValues = null, ?ResolveInfo $info = null); |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @inheritdoc |
||
| 28 | */ |
||
| 29 | public function resolveType($rootValue, $contextValues = null, ?ResolveInfo $info = null): ?callable |
||
| 30 | { |
||
| 31 | // Override this method when your resolver returns an interface or an union type. |
||
| 32 | return null; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return callable|null |
||
| 37 | */ |
||
| 38 | public function getResolveCallback(): ?callable |
||
| 39 | { |
||
| 40 | return function ($rootValue, array $args, $contextValues = null, ?ResolveInfo $info = null) { |
||
| 41 | return $this->resolve(...\func_get_args()); |
||
| 42 | }; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return callable|null |
||
| 47 | */ |
||
| 48 | public function getTypeResolver(): ?callable |
||
| 52 | }; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.