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 (#461)
by
unknown
21:27
created

FormConfigProcessor   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 9
eloc 19
dl 0
loc 44
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process() 0 16 3
A transformArgs() 0 13 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition\ConfigProcessor;
6
7
use GraphQL\Type\Definition\ResolveInfo;
8
use Overblog\GraphQLBundle\Definition\Builder\FormDescriber;
9
use Overblog\GraphQLBundle\Definition\LazyConfig;
10
use Overblog\GraphQLBundle\Error\UserWarning;
11
use Overblog\GraphQLBundle\Resolver\AccessResolver;
12
13
final class FormConfigProcessor implements ConfigProcessorInterface
14
{
15
    /** @var FormDescriber */
16
    private $describer;
17
18
    /** @var callable */
19
    private $defaultResolver;
0 ignored issues
show
introduced by
The private property $defaultResolver is not used, and could be removed.
Loading history...
20
21
    public function __construct(FormDescriber $describer)
22
    {
23
        $this->describer = $describer;
24
    }
25
26
    public static function transformArgs(array $fields, FormDescriber $describer)
27
    {
28
        dump($fields);
0 ignored issues
show
Bug introduced by
The function dump was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

28
        /** @scrutinizer ignore-call */ 
29
        dump($fields);
Loading history...
29
        foreach ($fields as &$field) {
30
            if (isset($field['form'])) {
31
                //dump($field['argsForm']);
32
                $args = $describer->describe($field['form']);
33
                unset($field['form']);                
34
                $field['args'] = isset($field['args']) && \is_array($field['args']) ? \array_merge($args, $field['args']) : $args;
35
            }
36
        }
37
38
        return $fields;
39
    }
40
41
    public function process(LazyConfig $lazyConfig): LazyConfig
42
    {
43
        $lazyConfig->addPostLoader(function ($config) {
44
            dump($config);
0 ignored issues
show
Bug introduced by
The function dump was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
            /** @scrutinizer ignore-call */ 
45
            dump($config);
Loading history...
45
            if (isset($config['fields']) && \is_callable($config['fields'])) {
46
                $config['fields'] = function () use ($config) {
47
                    $fields = $config['fields']();
48
49
                    return static::transformArgs($fields, $this->describer);
50
                };
51
            }
52
53
            return $config;
54
        });
55
56
        return $lazyConfig;
57
    }
58
}
59