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 — annotations (#445)
by Vincent
20:51
created

RelayEdgeFieldsBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toMappingDefinition() 0 17 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 RelayEdgeFieldsBuilder implements MappingInterface
10
{
11
    public function toMappingDefinition(array $config): array
12
    {
13
        if (!isset($config['nodeType']) || !\is_string($config['nodeType'])) {
14
            throw new \InvalidArgumentException('Using the Relay Edge fields builder, the key "nodeType" defining the GraphQL type of the node is required and must be a string.');
15
        }
16
17
        $nodeType = $config['nodeType'];
18
        $nodeDescription = $config['nodeDescription'] ?? 'Node of the Edge';
19
20
        return [
21
            'node' => [
22
                'description' => $nodeDescription,
23
                'type' => $nodeType,
24
            ],
25
            'cursor' => [
26
                'description' => 'The edge cursor',
27
                'type' => 'String!',
28
            ],
29
        ];
30
    }
31
}
32