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

DescriptionNode::cleanAstDescription()   A

Complexity

Conditions 4
Paths 5

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 9.8333
c 0
b 0
f 0
cc 4
nc 5
nop 1
crap 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