Completed
Pull Request — master (#70)
by Christoffer
02:06
created

FieldNode::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Digia\GraphQL\Language\Node;
4
5
use Digia\GraphQL\Language\Node\NodeKindEnum;
6
7
class FieldNode extends AbstractNode implements SelectionNodeInterface
8
{
9
10
    use AliasTrait;
11
    use NameTrait;
12
    use ArgumentsTrait;
13
    use DirectivesTrait;
14
    use SelectionSetTrait;
15
16
    /**
17
     * @var string
18
     */
19
    protected $kind = NodeKindEnum::FIELD;
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function toArray(): array
25
    {
26
        return [
27
            'kind'         => $this->kind,
28
            'loc'          => $this->getLocationAsArray(),
29
            'alias'        => $this->getAliasAsArray(),
30
            'name'         => $this->getNameAsArray(),
31
            'arguments'    => $this->getArgumentsAsArray(),
32
            'directives'   => $this->getDirectivesAsArray(),
33
            'selectionSet' => $this->getSelectionSetAsArray(),
34
        ];
35
    }
36
}
37