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 (#7)
by Jérémiah
09:02
created

ConfigResolver   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 88.89%

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 16
cts 18
cp 0.8889
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefaultResolveFn() 0 6 1
A getDefaultResolveFn() 0 4 1
B resolve() 0 17 6
A supportedSolutionClass() 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 26
    public function setDefaultResolveFn(callable $defaultResolveFn)
24
    {
25 26
        Executor::setDefaultResolveFn($defaultResolveFn);
26
27 26
        $this->defaultResolveFn = $defaultResolveFn;
28 26
    }
29
30
    public function getDefaultResolveFn()
31
    {
32
        return $this->defaultResolveFn;
33
    }
34
35 32
    public function resolve($config)
36
    {
37 32
        if (!is_array($config) || $config instanceof \ArrayAccess) {
38 1
            throw new \RuntimeException('Config must be an array or implement \ArrayAccess interface');
39
        }
40
41 31
        foreach ($config as $name => &$values) {
42 31
            if ((!$solution = $this->getSolution($name)) || empty($values)) {
43 31
                continue;
44
            }
45 26
            $options = $this->getSolutionOptions($name);
46
47 26
            $values = call_user_func_array([$solution, $options['method']], [$values]);
48 31
        }
49
50 31
        return $config;
51
    }
52
53 26
    protected function supportedSolutionClass()
54
    {
55 26
        return 'Overblog\\GraphQLBundle\\Resolver\\Config\\ConfigSolutionInterface';
56
    }
57
}
58