Field::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 13
nc 1
nop 6
crap 1
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 Field extends Node implements SelectionInterface
9
{
10
    const KIND = Node::KIND_FIELD;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param \Fubhy\GraphQL\Language\Node\Name $name
16
     * @param \Fubhy\GraphQL\Language\Node\Name $alias
17
     * @param \Fubhy\GraphQL\Language\Node\Argument[] $arguments
18
     * @param \Fubhy\GraphQL\Language\Node\Directive[] $directives
19
     * @param \Fubhy\GraphQL\Language\Node\SelectionSet $selectionSet
20
     * @param \Fubhy\GraphQL\Language\Location $location
21
     */
22 309
    public function __construct(
23
        Name $name,
24
        Name $alias = NULL,
25
        array $arguments = [],
26
        array $directives = [],
27
        SelectionSet $selectionSet = NULL,
28
        Location $location = NULL
29
    ) {
30 309
        parent::__construct($location, [
31 309
            'name' => $name,
32 309
            'alias' => $alias,
33 309
            'arguments' => $arguments,
34 309
            'directives' => $directives,
35 309
            'selectionSet' => $selectionSet,
36 309
        ]);
37 309
    }
38
}
39