NonNullType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 19
ccs 4
cts 5
cp 0.8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 3
1
<?php
2
3
namespace Fubhy\GraphQL\Language\Node;
4
5
use Fubhy\GraphQL\Language\Location;
6
use Fubhy\GraphQL\Language\Node;
7
8
class NonNullType extends Node implements TypeInterface
9
{
10
    const KIND = Node::KIND_NON_NULL_TYPE;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param \Fubhy\GraphQL\Language\Node\TypeInterface $type
16
     * @param \Fubhy\GraphQL\Language\Location $location
17
     */
18 45
    public function __construct(TypeInterface $type, Location $location = NULL)
19
    {
20 45
        if (!($type instanceof NamedType || $type instanceof ListType)) {
21
            throw new \InvalidArgumentException(sprintf('Invalid type %s.', get_class($type)));
22
        }
23
24 45
        parent::__construct($location, ['type' => $type]);
25 45
    }
26
}
27