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 ( 6eaf22...743834 )
by Renato
56s
created

TypeWithOutputFieldsDefinition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 6
dl 0
loc 60
ccs 43
cts 43
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A outputFieldsSelection() 0 52 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config;
4
5
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
8
abstract class TypeWithOutputFieldsDefinition extends TypeDefinition
9
{
10
    /**
11
     * @param string $name
12
     *
13
     * @return ArrayNodeDefinition|\Symfony\Component\Config\Definition\Builder\NodeDefinition
14
     */
15 29
    protected function outputFieldsSelection($name)
16
    {
17 29
        $builder = new TreeBuilder();
18 29
        $node = $builder->root($name);
19
        $node
20 29
            ->isRequired()
21 29
            ->requiresAtLeastOneElement();
22
23
        /* @var ArrayNodeDefinition $prototype */
24 29
        $prototype = $node->useAttributeAsKey('name', false)->prototype('array');
25
26
        $prototype
27 29
            ->children()
28 29
                ->append($this->typeSelection())
29 29
                ->arrayNode('args')
30 29
                    ->info('Array of possible type arguments. Each entry is expected to be an array with following keys: name (string), type')
31 29
                    ->useAttributeAsKey('name', false)
32 29
                    ->prototype('array')
33
                        // Allow arg type short syntax (Arg: Type => Arg: {type: Type})
34 29
                        ->beforeNormalization()
35 29
                            ->ifTrue(function ($options) {
36 17
                                return is_string($options);
37 29
                            })
38 29
                            ->then(function ($options) {
39 1
                                return ['type' => $options];
40 29
                            })
41 29
                        ->end()
42 29
                        ->children()
43 29
                            ->append($this->typeSelection(true))
44 29
                            ->append($this->descriptionSection())
45 29
                            ->append($this->defaultValueSection())
46 29
                        ->end()
47 29
                    ->end()
48 29
                ->end()
49 29
                ->variableNode('resolve')
50 29
                    ->info('Value resolver (expression language can be use here)')
51 29
                ->end()
52 29
                ->append($this->descriptionSection())
53 29
                ->append($this->deprecationReasonSelection())
54 29
                ->variableNode('access')
55 29
                    ->info('Access control to field (expression language can be use here)')
56 29
                ->end()
57 29
                ->variableNode('public')
58 29
                    ->info('Visibility control to field (expression language can be use here)')
59 29
                ->end()
60 29
                ->variableNode('complexity')
61 29
                    ->info('Custom complexity calculator.')
62 29
                ->end()
63 29
            ->end();
64
65 29
        return $node;
66
    }
67
}
68