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
Push — annotations ( 42a852...be29b8 )
by Jérémiah
15s queued 11s
created

RelayConnectionFieldsBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 14
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toMappingDefinition() 0 20 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Relay\Builder;
6
7
use Overblog\GraphQLBundle\Definition\Builder\MappingInterface;
8
9
class RelayConnectionFieldsBuilder implements MappingInterface
10
{
11 3
    public function toMappingDefinition(array $config): array
12
    {
13 3
        if (!isset($config['edgeType']) || !\is_string($config['edgeType'])) {
14 2
            throw new \InvalidArgumentException('Using the Relay Connection fields builder, the key "edgeType" defining the GraphQL type of edges is required and must be a string.');
15
        }
16
17 1
        $edgeType = $config['edgeType'];
18 1
        $edgeDescription = $config['edgeDescription'] ?? 'Edges of the connection';
19
20 1
        $pageInfoType = $config['pageInfoType'] ?? 'PageInfo';
21 1
        $pageInfoDescription = $config['pageInfoDescription'] ?? 'Page info of the connection';
22
23
        return [
24
            'edges' => [
25 1
                'description' => $edgeDescription,
26 1
                'type' => \sprintf('[%s]', $edgeType),
27
            ],
28
            'pageInfo' => [
29 1
                'description' => $pageInfoDescription,
30 1
                'type' => $pageInfoType,
31
            ],
32
        ];
33
    }
34
}
35