Field   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 54.55%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 28
ccs 6
cts 11
cp 0.5455
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getChildren() 0 7 1
1
<?php
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class Field extends NodeBase
6
{
7
    public $name;
8
    public $type;
9
    public $arguments;
10
11
    /**
12
     * @param string $name
13
     * @param Type $type
14
     * @param Argument[] $arguments
15
     * @param Location|null $location
16
     */
17 9
    public function __construct($name, Type $type, array $arguments = array(), Location $location = null)
18
    {
19 9
        parent::__construct($location);
20 9
        $this->name = (string) $name;
21 9
        $this->type = $type;
22 9
        $this->arguments = $arguments;
23 9
    }
24
25
    public function getChildren()
26
    {
27
        return array_merge(
28
            array($this->type),
29
            $this->arguments
30
        );
31
    }
32
}
33