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
Push — annotations ( 582d88...d84805 )
by Jérémiah
28:13 queued 19:34
created

EnumTypeDefinition::getDefinition()   A

Complexity

Conditions 5
Paths 1

Size

Total Lines 44
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 31
CRAP Score 5

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 44
ccs 31
cts 31
cp 1
rs 9.1128
c 0
b 0
f 0
cc 5
nc 1
nop 0
crap 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Config;
6
7
class EnumTypeDefinition extends TypeDefinition
8
{
9 37
    public function getDefinition()
10
    {
11 37
        $node = self::createNode('_enum_config');
12
13
        $node
14 37
            ->children()
15 37
                ->append($this->nameSection())
16 37
                ->arrayNode('values')
17 37
                    ->useAttributeAsKey('name')
18 37
                    ->beforeNormalization()
19
                        ->ifTrue(function ($v) {
20 4
                            return \is_array($v);
21 37
                        })
22
                        ->then(function ($v) {
23 4
                            foreach ($v as $name => &$options) {
24
                                // short syntax NAME: VALUE
25 4
                                if (!\is_null($options) && !\is_array($options)) {
26 2
                                    $options = ['value' => $options];
27
                                }
28
29
                                // use name as value if no value given
30 4
                                if (!\array_key_exists('value', $options)) {
0 ignored issues
show
Bug introduced by
It seems like $options can also be of type null; however, parameter $search of array_key_exists() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

30
                                if (!\array_key_exists('value', /** @scrutinizer ignore-type */ $options)) {
Loading history...
31 4
                                    $options['value'] = $name;
32
                                }
33
                            }
34
35 4
                            return $v;
36 37
                        })
37 37
                    ->end()
38 37
                    ->prototype('array')
39 37
                        ->isRequired()
40 37
                        ->children()
41 37
                            ->scalarNode('value')->isRequired()->end()
42 37
                            ->append($this->descriptionSection())
43 37
                            ->append($this->deprecationReasonSelection())
44 37
                        ->end()
45 37
                    ->end()
46 37
                    ->isRequired()
47 37
                    ->requiresAtLeastOneElement()
48 37
                ->end()
49 37
                ->append($this->descriptionSection())
50 37
            ->end();
51
52 37
        return $node;
53
    }
54
}
55