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

Completed
Pull Request — master (#536)
by
unknown
20:43
created

GlobalID::isTypeNameEmpty()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 4
nc 4
nop 1
crap 20
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction\GraphQL\Relay;
6
7
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction;
8
use Overblog\GraphQLBundle\Relay\Node\GlobalId as GlobalIdHelper;
9
10
final class GlobalID extends ExpressionFunction
11 122
{
12
    public function __construct($name = 'globalId')
13 122
    {
14 122
        parent::__construct(
15
            $name,
16 1
            function (string $id, string $typeName = null): string {
17
                $typeName = $this->isTypeNameEmpty($typeName) ? '$info->parentType->name' : $typeName;
18 1
19 1
                return \sprintf('\%s::toGlobalId(%s, %s)', GlobalIdHelper::class, $typeName, $id);
20 1
            },
21 1
            function ($arguments, $id, $typeName = null) {
22 1
                $typeName = $this->isTypeNameEmpty($typeName) ? $arguments['info']->parentType->name : $typeName;
23
24 122
                return GlobalIdHelper::toGlobalId($typeName, $id);
25
            }
26 122
        );
27
    }
28
29
    private function isTypeNameEmpty($typeName)
30
    {
31
        return null === $typeName || '""' === $typeName || 'null' === $typeName || 'false' === $typeName;
32
    }
33
}
34