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 ( d853e3...ce3247 )
by Jérémiah
18:11 queued 06:56
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
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
6
7
use GraphQL\Language\AST\Node;
8
use GraphQL\Utils\AST;
9
10
class FieldsNode implements NodeInterface
11
{
12 2
    public static function toConfig(Node $node, $property = 'fields'): array
13
    {
14 2
        $config = [];
15 2
        if (!empty($node->$property)) {
16 2
            foreach ($node->$property as $definition) {
17 2
                $fieldConfig = TypeNode::toConfig($definition) + DescriptionNode::toConfig($definition);
18
19 2
                if (!empty($definition->arguments)) {
20 2
                    $fieldConfig['args'] = self::toConfig($definition, 'arguments');
21
                }
22
23 2
                if (!empty($definition->defaultValue)) {
24 1
                    $fieldConfig['defaultValue'] = AST::valueFromASTUntyped($definition->defaultValue);
25
                }
26
27 2
                $directiveConfig = DirectiveNode::toConfig($definition);
28 2
                if (isset($directiveConfig['deprecationReason'])) {
29 1
                    $fieldConfig['deprecationReason'] = $directiveConfig['deprecationReason'];
30
                }
31
32 2
                $config[$definition->name->value] = $fieldConfig;
33
            }
34
        }
35
36 2
        return $config;
37
    }
38
}
39