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

AbstractResolver::getResolveMethod()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
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