Completed
Push — master ( 7faae5...9f7b4d )
by Christoffer
02:27
created

InterfaceTypeExtensionNode::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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