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

TypeNode::astTypeNodeToString()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 10
cts 10
cp 1
rs 9.6333
c 0
b 0
f 0
cc 4
nc 4
nop 1
crap 4
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\Language\AST\NodeKind;
9
10
class TypeNode implements NodeInterface
11
{
12 2
    public static function toConfig(Node $node): array
13
    {
14 2
        return ['type' => self::astTypeNodeToString($node->type)];
15
    }
16
17 2
    public static function astTypeNodeToString(\GraphQL\Language\AST\TypeNode $typeNode): string
18
    {
19 2
        $type = '';
20 2
        switch ($typeNode->kind) {
21
            case NodeKind::NAMED_TYPE:
22 2
                $type = $typeNode->name->value;
23 2
                break;
24
25
            case NodeKind::NON_NULL_TYPE:
26 2
                $type = self::astTypeNodeToString($typeNode->type).'!';
27 2
                break;
28
29
            case NodeKind::LIST_TYPE:
30 2
                $type = '['.self::astTypeNodeToString($typeNode->type).']';
31 2
                break;
32
        }
33
34 2
        return $type;
35
    }
36
}
37