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 — 0.11 (#375)
by Jérémiah
16:24
created

EnumNode::toConfig()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 13
cts 13
cp 1
rs 9.52
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 3
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
4
5
use GraphQL\Language\AST\Node;
6
7
class EnumNode implements NodeInterface
8
{
9 2
    public static function toConfig(Node $node)
10
    {
11
        $config = [
12 2
            'description' => DescriptionNode::toConfig($node),
13
        ];
14
15 2
        $values = [];
16 2
        foreach ($node->values as $value) {
0 ignored issues
show
Bug introduced by
The property values does not seem to exist in GraphQL\Language\AST\Node.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
17 2
            $values[$value->name->value] = [
18 2
                'description' => DescriptionNode::toConfig($node),
19 2
                'value' => $value->name->value,
20
            ];
21
22 2
            $directiveConfig = DirectiveNode::toConfig($value);
23 2
            if (isset($directiveConfig['deprecationReason'])) {
24 2
                $values[$value->name->value]['deprecationReason'] = $directiveConfig['deprecationReason'];
25
            }
26
        }
27 2
        $config['values'] = $values;
28
29
        return [
30 2
            'type' => 'enum',
31 2
            'config' => $config,
32
        ];
33
    }
34
}
35