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 — annotations ( f1d4ce...7c334e )
by Jérémiah
19:48
created

TypeWithOutputFieldsDefinition   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 50
dl 0
loc 71
ccs 48
cts 48
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A outputFieldsSelection() 0 49 1
A fieldsBuilderSection() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Config;
6
7
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8
9
abstract class TypeWithOutputFieldsDefinition extends TypeDefinition
10
{
11
    /**
12
     * @param string $name
13
     *
14
     * @return ArrayNodeDefinition|\Symfony\Component\Config\Definition\Builder\NodeDefinition
15
     */
16 37
    protected function outputFieldsSelection(string $name = 'fields')
17
    {
18 37
        $node = self::createNode($name);
19
        $node
20 37
            ->isRequired()
21 37
            ->requiresAtLeastOneElement();
0 ignored issues
show
Bug introduced by
The method requiresAtLeastOneElement() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

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

21
            ->/** @scrutinizer ignore-call */ requiresAtLeastOneElement();
Loading history...
22
        /* @var ArrayNodeDefinition $prototype */
23 37
        $prototype = $node->useAttributeAsKey('name', false)->prototype('array');
0 ignored issues
show
Bug introduced by
The method useAttributeAsKey() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

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

23
        $prototype = $node->/** @scrutinizer ignore-call */ useAttributeAsKey('name', false)->prototype('array');
Loading history...
24
25
        $prototype
26 37
            ->children()
27 37
                ->append($this->typeSelection())
28 37
                ->arrayNode('args')
29 37
                    ->info('Array of possible type arguments. Each entry is expected to be an array with following keys: name (string), type')
30 37
                    ->useAttributeAsKey('name', false)
31 37
                    ->prototype('array')
32
                        // Allow arg type short syntax (Arg: Type => Arg: {type: Type})
33 37
                        ->beforeNormalization()
34
                            ->ifTrue(function ($options) {
35 24
                                return \is_string($options);
36 37
                            })
37
                            ->then(function ($options) {
38 2
                                return ['type' => $options];
39 37
                            })
40 37
                        ->end()
41 37
                        ->children()
42 37
                            ->append($this->typeSelection(true))
43 37
                            ->append($this->descriptionSection())
44 37
                            ->append($this->defaultValueSection())
45 37
                        ->end()
46 37
                    ->end()
47 37
                ->end()
48 37
                ->variableNode('resolve')
49 37
                    ->info('Value resolver (expression language can be use here)')
50 37
                ->end()
51 37
                ->append($this->descriptionSection())
52 37
                ->append($this->deprecationReasonSelection())
53 37
                ->variableNode('access')
54 37
                    ->info('Access control to field (expression language can be use here)')
55 37
                ->end()
56 37
                ->variableNode('public')
57 37
                    ->info('Visibility control to field (expression language can be use here)')
58 37
                ->end()
59 37
                ->variableNode('complexity')
60 37
                    ->info('Custom complexity calculator.')
61 37
                ->end()
62 37
            ->end();
63
64 37
        return $node;
65
    }
66
67 37
    protected function fieldsBuilderSection()
68
    {
69 37
        $node = self::createNode('builders');
70
71 37
        $prototype = $node->prototype('array');
0 ignored issues
show
Bug introduced by
The method prototype() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

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

71
        /** @scrutinizer ignore-call */ 
72
        $prototype = $node->prototype('array');
Loading history...
72
73
        $prototype
74 37
            ->children()
75 37
                ->variableNode('builder')->isRequired()->end()
76 37
                ->variableNode('builderConfig')->end()
77 37
            ->end();
78
79 37
        return $node;
80
    }
81
}
82