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 — master (#786)
by Timur
20:36
created

GlobalIdFieldQuery::getAliases()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\GraphQL\Relay\Node;
6
7
use GraphQL\Type\Definition\ResolveInfo;
8
use Overblog\GraphQLBundle\Definition\Resolver\AliasedInterface;
9
use Overblog\GraphQLBundle\Definition\Resolver\QueryInterface;
10
use Overblog\GraphQLBundle\Relay\Node\GlobalId;
11
use Overblog\GraphQLBundle\Resolver\FieldResolver;
12
13
final class GlobalIdFieldQuery implements QueryInterface, AliasedInterface
14
{
15
    /**
16
     * @param object|array    $obj
17
     * @param int|string|null $idValue
18
     */
19
    public function __invoke($obj, ResolveInfo $info, $idValue, ?string $typeName): string
20
    {
21
        return GlobalId::toGlobalId(
22
            !empty($typeName) ? $typeName : $info->parentType->name,
23
            $idValue ? $idValue : FieldResolver::valueFromObjectOrArray($obj, 'id')
24
        );
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public static function getAliases(): array
31
    {
32
        return ['__invoke' => 'relay_globalid_field'];
33
    }
34
}
35