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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 28
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toConfig() 0 25 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