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 — master ( 48eab4...bce55d )
by Jérémiah
14:36
created

EnumNode::toConfig()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 12
cts 12
cp 1
rs 9.568
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
6
7
use GraphQL\Language\AST\Node;
8
9
class EnumNode implements NodeInterface
10
{
11 2
    public static function toConfig(Node $node): array
12
    {
13 2
        $config = DescriptionNode::toConfig($node);
14
15 2
        $values = [];
16 2
        foreach ($node->values as $value) {
17 2
            $values[$value->name->value] = DescriptionNode::toConfig($node) + [
18 2
                'value' => $value->name->value,
19
            ];
20
21 2
            $directiveConfig = DirectiveNode::toConfig($value);
22 2
            if (isset($directiveConfig['deprecationReason'])) {
23 2
                $values[$value->name->value]['deprecationReason'] = $directiveConfig['deprecationReason'];
24
            }
25
        }
26 2
        $config['values'] = $values;
27
28
        return [
29 2
            'type' => 'enum',
30 2
            'config' => $config,
31
        ];
32
    }
33
}
34