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

Passed
Push — master ( b9b49e...4b752f )
by Jérémiah
48s
created

WrapArgumentConfigProcessor::process()   B

Complexity

Conditions 5
Paths 1

Size

Total Lines 23
Code Lines 12

Duplication

Lines 3
Ratio 13.04 %

Code Coverage

Tests 12
CRAP Score 5

Importance

Changes 0
Metric Value
dl 3
loc 23
ccs 12
cts 12
cp 1
rs 8.5906
c 0
b 0
f 0
cc 5
eloc 12
nc 1
nop 1
crap 5
1
<?php
2
3
namespace Overblog\GraphQLBundle\Definition\ConfigProcessor;
4
5
use Overblog\GraphQLBundle\Definition\LazyConfig;
6
use Overblog\GraphQLBundle\Resolver\Resolver;
7
8
final class WrapArgumentConfigProcessor implements ConfigProcessorInterface
9
{
10
    public function process(LazyConfig $lazyConfig)
11
    {
12 78
        $lazyConfig->addPostLoader(function ($config) {
13 78 View Code Duplication
            if (isset($config['resolveField']) && is_callable($config['resolveField'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14 10
                $config['resolveField'] = Resolver::wrapArgs($config['resolveField']);
15
            }
16
17 78
            if (isset($config['fields'])) {
18 73
                $config['fields'] = function () use ($config) {
19 73
                    $fields = $config['fields'];
20 73
                    if (is_callable($config['fields'])) {
21 73
                        $fields = $config['fields']();
22
                    }
23
24 73
                    return self::wrapFieldsArgument($fields);
25
                };
26
            }
27
28 78
            return $config;
29 78
        });
30
31 78
        return $lazyConfig;
32
    }
33
34 73
    private static function wrapFieldsArgument(array $fields)
35
    {
36 73
        foreach ($fields as &$field) {
37 73 View Code Duplication
            if (isset($field['resolve']) && is_callable($field['resolve'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38 73
                $field['resolve'] = Resolver::wrapArgs($field['resolve']);
39
            }
40
        }
41
42 73
        return $fields;
43
    }
44
}
45