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

RelayEdgeFieldsBuilder::toMappingDefinition()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 17
ccs 8
cts 8
cp 1
rs 9.9
c 0
b 0
f 0
cc 3
nc 2
nop 1
crap 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 3
    public function toMappingDefinition(array $config): array
12
    {
13 3
        if (!isset($config['nodeType']) || !\is_string($config['nodeType'])) {
14 2
            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 1
        $nodeType = $config['nodeType'];
18 1
        $nodeDescription = $config['nodeDescription'] ?? 'Node of the Edge';
19
20
        return [
21 1
            'node' => [
22 1
                'description' => $nodeDescription,
23 1
                'type' => $nodeType,
24
            ],
25
            'cursor' => [
26
                'description' => 'The edge cursor',
27
                'type' => 'String!',
28
            ],
29
        ];
30
    }
31
}
32