Completed
Pull Request — master (#174)
by Christoffer
06:34
created

AbstractResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResolveMethod() 0 9 2
1
<?php
2
3
namespace Digia\GraphQL\Schema\Resolver;
4
5
class AbstractResolver implements ResolverInterface
6
{
7
    /**
8
     * @inheritdoc
9
     */
10
    public function getResolveMethod(string $fieldName): ?callable
11
    {
12
        $resolveMethod = 'resolve' . \ucfirst($fieldName);
13
14
        if (\method_exists($this, $resolveMethod)) {
15
            return [$this, $resolveMethod];
0 ignored issues
show
Bug Best Practice introduced by
The expression return array($this, $resolveMethod) returns the type array<integer,Digia\Grap...bstractResolver|string> which is incompatible with the type-hinted return null|callable.
Loading history...
16
        }
17
18
        return null;
19
    }
20
}
21