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

FieldNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 10 1
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