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
Pull Request — master (#438)
by Vincent
15:04
created

fieldsBuilderSection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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 38
    protected function outputFieldsSelection(string $name = 'fields')
17
    {
18 38
        $node = self::createNode($name);
19
20
        /* @var ArrayNodeDefinition $prototype */
21 38
        $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

21
        $prototype = $node->/** @scrutinizer ignore-call */ useAttributeAsKey('name', false)->prototype('array');
Loading history...
22
23
        $prototype
24 38
            ->children()
25 38
                ->append($this->typeSelection())
26 38
                ->arrayNode('args')
27 38
                    ->info('Array of possible type arguments. Each entry is expected to be an array with following keys: name (string), type')
28 38
                    ->useAttributeAsKey('name', false)
29 38
                    ->prototype('array')
30
                        // Allow arg type short syntax (Arg: Type => Arg: {type: Type})
31 38
                        ->beforeNormalization()
32
                            ->ifTrue(function ($options) {
33 24
                                return \is_string($options);
34 38
                            })
35
                            ->then(function ($options) {
36 2
                                return ['type' => $options];
37 38
                            })
38 38
                        ->end()
39 38
                        ->children()
40 38
                            ->append($this->typeSelection(true))
41 38
                            ->append($this->descriptionSection())
42 38
                            ->append($this->defaultValueSection())
43 38
                        ->end()
44 38
                    ->end()
45 38
                ->end()
46 38
                ->variableNode('resolve')
47 38
                    ->info('Value resolver (expression language can be use here)')
48 38
                ->end()
49 38
                ->append($this->descriptionSection())
50 38
                ->append($this->deprecationReasonSelection())
51 38
                ->variableNode('access')
52 38
                    ->info('Access control to field (expression language can be use here)')
53 38
                ->end()
54 38
                ->variableNode('public')
55 38
                    ->info('Visibility control to field (expression language can be use here)')
56 38
                ->end()
57 38
                ->variableNode('complexity')
58 38
                    ->info('Custom complexity calculator.')
59 38
                ->end()
60 38
            ->end();
61
62 38
        return $node;
63
    }
64
65 38
    protected function fieldsBuilderSection()
66
    {
67 38
        $node = self::createNode('builders');
68
69 38
        $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

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