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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
eloc 14
dl 0
loc 27
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

1 Method

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