Node   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\GraphQL\Type;
6
7
use ApiSkeletons\Doctrine\GraphQL\AbstractContainer;
8
use ApiSkeletons\Doctrine\GraphQL\Buildable;
9
use GraphQL\Type\Definition\ObjectType;
10
use GraphQL\Type\Definition\Type;
11
12
use function assert;
13
14
/**
15
 * This type is built within the TypeManager
16
 */
17
class Node extends ObjectType implements
18
    Buildable
19
{
20
    /** @param mixed[] $params */
21
    public function __construct(AbstractContainer $container, string $typeName, array $params)
22
    {
23
        assert($params[0] instanceof ObjectType);
24
25
        $configuration = [
26
            'name' => $typeName,
27
            'fields' => [
28
                'node' => $params[0],
29
                'cursor' => Type::nonNull(Type::string()),
30
            ],
31
        ];
32
33
        parent::__construct($configuration);
34
    }
35
}
36