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 (#35)
by Jérémiah
13:35
created

GlobalIdField   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 78.95%

Importance

Changes 3
Bugs 1 Features 2
Metric Value
wmc 5
c 3
b 1
f 2
lcom 0
cbo 6
dl 0
loc 27
ccs 15
cts 19
cp 0.7895
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B toMappingDefinition() 0 24 5
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Relay\Node;
13
14
use GraphQL\Type\Definition\Config;
15
use GraphQL\Type\Definition\ResolveInfo;
16
use Overblog\GraphQLBundle\Definition\Builder\MappingInterface;
17
use Overblog\GraphQLBundle\Definition\Type;
18
use Overblog\GraphQLBundle\Resolver\Resolver;
19
20
class GlobalIdField implements MappingInterface
21
{
22 2
    public function toMappingDefinition(array $config)
23
    {
24 2
        Config::validate($config, [
25 2
            'name' => Config::STRING | Config::REQUIRED,
26 2
            'typeName' => Config::STRING,
27 2
            'idFetcher' => Config::CALLBACK,
28 2
        ]);
29
30 2
        $name = $config['name'];
31 2
        $typeName = isset($config['typeName']) ? $config['typeName'] : null;
32 2
        $idFetcher = isset($config['idFetcher']) ? $config['idFetcher'] : null;
33
34
        return [
35 2
            'name' => $name,
36 2
            'description' => 'The ID of an object',
37 2
            'type' => Type::nonNull(Type::id()),
38 2
            'resolve' => function ($obj, $args, ResolveInfo $info) use ($idFetcher, $typeName) {
39
                return GlobalId::toGlobalId(
40
                    !empty($typeName) ? $typeName : $info->parentType->name,
41
                    is_callable($idFetcher) ? call_user_func_array($idFetcher, [$obj, $info]) : Resolver::valueFromObjectOrArray($obj, 'id')
42
                );
43 2
            },
44 2
        ];
45
    }
46
}
47