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

DescriptionNode   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toConfig() 0 4 1
A cleanAstDescription() 0 13 4
1
<?php
2
3
namespace Overblog\GraphQLBundle\Config\Parser\GraphQL\ASTConverter;
4
5
use GraphQL\Language\AST\Node;
6
7
class DescriptionNode implements NodeInterface
8
{
9 2
    public static function toConfig(Node $node)
10
    {
11 2
        return self::cleanAstDescription($node->description);
0 ignored issues
show
Bug introduced by
The property description 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...
Bug Compatibility introduced by
The expression self::cleanAstDescription($node->description); of type null|string adds the type string to the return on line 11 which is incompatible with the return type declared by the interface Overblog\GraphQLBundle\C...NodeInterface::toConfig of type array.
Loading history...
12
    }
13
14 2
    private static function cleanAstDescription($description)
15
    {
16 2
        if (null === $description) {
17 2
            return null;
18
        }
19
20 1
        if (\property_exists($description, 'value')) {
21 1
            $description = $description->value;
22
        }
23 1
        $description = \trim($description);
24
25 1
        return empty($description) ? null : $description;
26
    }
27
}
28