Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Pull Request — master (#4)
by Jérémiah
12:13
created

Resolver::defaultResolveFn()   B

Complexity

Conditions 6
Paths 14

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 8.8571
cc 6
eloc 11
nc 14
nop 3
1
<?php
2
3
namespace Overblog\GraphQLBundle\Resolver;
4
5
use GraphQL\Type\Definition\ResolveInfo;
6
use Symfony\Component\PropertyAccess\Exception\AccessException;
7
use Symfony\Component\PropertyAccess\PropertyAccess;
8
9
class Resolver
10
{
11
    public static function defaultResolveFn($source, $args, ResolveInfo $info)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13
        $fieldName = $info->fieldName;
14
        $property = null;
15
16
        $accessor = PropertyAccess::createPropertyAccessor();
17
18
        try {
19
            if (is_array($source) || $source instanceof \ArrayAccess) {
20
                $property = $accessor->getValue($source, sprintf('[%s]', $fieldName));
21
            } else if (is_object($source)) {
22
                $property = $accessor->getValue($source, sprintf('%s', $fieldName));
23
            }
24
        } catch(AccessException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
25
        }
26
27
        return $property instanceof \Closure ? $property($source) : $property;
28
    }
29
}
30
31