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

InterfaceTypeExtensionNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

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