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 ( 582d88...d84805 )
by Jérémiah
28:13 queued 19:34
created

FieldsNode::toConfig()   A

Complexity

Conditions 6
Paths 2

Size

Total Lines 25
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 25
ccs 14
cts 14
cp 1
rs 9.2222
c 0
b 0
f 0
cc 6
nc 2
nop 2
crap 6
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