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
Pull Request — 0.11 (#400)
by Jáchym
16:58
created

FieldsNode::astValueNodeToConfig()   B

Complexity

Conditions 9
Paths 8

Size

Total Lines 26

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 9

Importance

Changes 0
Metric Value
dl 0
loc 26
ccs 12
cts 12
cp 1
rs 8.0555
c 0
b 0
f 0
cc 9
nc 8
nop 1
crap 9
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
4
5
use GraphQL\Language\AST\Node;
6
use GraphQL\Utils\AST;
7
8
class FieldsNode implements NodeInterface
9
{
10 2
    public static function toConfig(Node $node, $property = 'fields')
11
    {
12 2
        $config = [];
13 2
        if (!empty($node->$property)) {
14 2
            foreach ($node->$property as $definition) {
15
                $fieldConfig = [
16 2
                    'type' => TypeNode::toConfig($definition),
17 2
                    'description' => DescriptionNode::toConfig($definition),
18
                ];
19
20 2
                if (!empty($definition->arguments)) {
21 2
                    $fieldConfig['args'] = self::toConfig($definition, 'arguments');
22
                }
23
24 2
                if (!empty($definition->defaultValue)) {
25 1
                    $fieldConfig['defaultValue'] = AST::valueFromASTUntyped($definition->defaultValue);
26
                }
27
28 2
                $directiveConfig = DirectiveNode::toConfig($definition);
29 2
                if (isset($directiveConfig['deprecationReason'])) {
30 1
                    $fieldConfig['deprecationReason'] = $directiveConfig['deprecationReason'];
31
                }
32
33 2
                $config[$definition->name->value] = $fieldConfig;
34
            }
35
        }
36
37 2
        return $config;
38
    }
39
}
40