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::toMappingDefinition()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 17
rs 9.9
c 0
b 0
f 0
cc 3
nc 2
nop 1
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