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 — 0.11 ( 393b72...07e5a8 )
by Jérémiah
53s
created

DirectiveNode::toConfig()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 9.7333
c 0
b 0
f 0
cc 4
nc 4
nop 1
crap 4
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
4
5
use GraphQL\Language\AST\Node;
6
use GraphQL\Type\Definition\Directive;
7
8
class DirectiveNode implements NodeInterface
9
{
10 2
    public static function toConfig(Node $node)
11
    {
12 2
        $config = [];
13
14 2
        foreach ($node->directives as $directiveDef) {
0 ignored issues
show
Bug introduced by
The property directives does not seem to exist in GraphQL\Language\AST\Node.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
15 1
            if ('deprecated' === $directiveDef->name->value) {
16 1
                $reason = $directiveDef->arguments->count() ?
17 1
                    $directiveDef->arguments[0]->value->value : Directive::DEFAULT_DEPRECATION_REASON;
18
19 1
                $config['deprecationReason'] = $reason;
20 1
                break;
21
            }
22
        }
23
24 2
        return $config;
25
    }
26
}
27