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
Pull Request — 0.11 (#375)
by Jérémiah
16:24
created

ObjectNode::toConfig()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 20

Duplication

Lines 20
Ratio 100 %

Code Coverage

Tests 10
CRAP Score 3

Importance

Changes 0
Metric Value
dl 20
loc 20
ccs 10
cts 10
cp 1
rs 9.6
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 3
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
4
5
use GraphQL\Language\AST\Node;
6
7
class ObjectNode implements NodeInterface
8
{
9
    const TYPENAME = 'object';
10
11 2 View Code Duplication
    public static function toConfig(Node $node)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    {
13
        $config = [
14 2
            'description' => DescriptionNode::toConfig($node),
15 2
            'fields' => FieldsNode::toConfig($node),
16
        ];
17
18 2
        if (!empty($node->interfaces)) {
19 2
            $interfaces = [];
20 2
            foreach ($node->interfaces as $interface) {
0 ignored issues
show
Bug introduced by
The property interfaces 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...
21 2
                $interfaces[] = TypeNode::astTypeNodeToString($interface);
22
            }
23 2
            $config['interfaces'] = $interfaces;
24
        }
25
26
        return [
27 2
            'type' => static::TYPENAME,
28 2
            'config' => $config,
29
        ];
30
    }
31
}
32