ValueObjectField::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class ValueObjectField extends NodeBase
6
{
7
    public $name;
8
    public $value;
9
10
    /**
11
     * @param string $name
12
     * @param Value $value
13
     * @param Location|null $location
14
     */
15 3
    public function __construct($name, Value $value, Location $location = null)
16
    {
17 3
        parent::__construct($location);
18 3
        $this->name = (string) $name;
19 3
        $this->value = $value;
20 3
    }
21
22
    public function getChildren()
23
    {
24
        return array($this->value);
25
    }
26
}
27