1 | <?php |
||||||||
2 | |||||||||
3 | namespace Digia\GraphQL\Schema\Resolver; |
||||||||
4 | |||||||||
5 | use Digia\GraphQL\Execution\ResolveInfo; |
||||||||
6 | |||||||||
7 | trait ResolverTrait |
||||||||
8 | { |
||||||||
9 | /** |
||||||||
10 | * @return callable|null |
||||||||
11 | */ |
||||||||
12 | public function getTypeResolver(): ?callable |
||||||||
13 | { |
||||||||
14 | return function ($rootValue, $context = null, ?ResolveInfo $info = null) { |
||||||||
15 | return $this->resolveType($rootValue, $context, $info); |
||||||||
0 ignored issues
–
show
|
|||||||||
16 | }; |
||||||||
17 | } |
||||||||
18 | |||||||||
19 | /** |
||||||||
20 | * @param mixed $rootValue |
||||||||
21 | * @param mixed $context |
||||||||
22 | * @param ResolveInfo|null $info |
||||||||
23 | * @return callable|null |
||||||||
24 | */ |
||||||||
25 | public function resolveType($rootValue, $context = null, ?ResolveInfo $info = null): ?callable |
||||||||
0 ignored issues
–
show
The parameter
$info is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$rootValue is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$context is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||||
26 | { |
||||||||
27 | // Override this method when your resolver returns an interface or an union type. |
||||||||
28 | return null; |
||||||||
29 | } |
||||||||
30 | |||||||||
31 | /** |
||||||||
32 | * @return array|null |
||||||||
33 | */ |
||||||||
34 | public function getMiddleware(): ?array |
||||||||
35 | { |
||||||||
36 | return null; |
||||||||
37 | } |
||||||||
38 | } |
||||||||
39 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.