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

Completed
Pull Request — master (#23)
by Jérémiah
13:51 queued 05:06
created

ConfigResolver   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 10
Bugs 3 Features 2
Metric Value
wmc 9
c 10
b 3
f 2
lcom 1
cbo 2
dl 0
loc 42
ccs 18
cts 18
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefaultResolveFn() 0 6 1
B resolve() 0 17 6
A supportedSolutionClass() 0 4 1
A getDefaultResolveFn() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Resolver;
13
14
use GraphQL\Executor\Executor;
15
16
class ConfigResolver extends AbstractResolver
17
{
18
    /**
19
     * @var callable
20
     */
21
    private $defaultResolveFn = ['GraphQL\Executor\Executor', 'defaultResolveFn'];
22
23 36
    public function setDefaultResolveFn(callable $defaultResolveFn)
24
    {
25 36
        Executor::setDefaultResolveFn($defaultResolveFn);
26
27 36
        $this->defaultResolveFn = $defaultResolveFn;
28 36
    }
29
30 7
    public function getDefaultResolveFn()
31
    {
32 7
        return $this->defaultResolveFn;
33
    }
34
35 42
    public function resolve($config)
36
    {
37 42
        if (!is_array($config) || $config instanceof \ArrayAccess) {
38 1
            throw new \RuntimeException('Config must be an array or implement \ArrayAccess interface');
39
        }
40
41 41
        foreach ($config as $name => &$values) {
42 41
            if ((!$solution = $this->getSolution($name)) || empty($values)) {
43 41
                continue;
44
            }
45 36
            $options = $this->getSolutionOptions($name);
46
47 36
            $values = call_user_func_array([$solution, $options['method']], [$values, &$config]);
48 41
        }
49
50 41
        return $config;
51
    }
52
53 36
    protected function supportedSolutionClass()
54
    {
55 36
        return 'Overblog\\GraphQLBundle\\Resolver\\Config\\ConfigSolutionInterface';
56
    }
57
}
58