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

ScalarTypeExtensionNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 7 1
1
<?php
2
3
namespace Digia\GraphQL\Language\AST\Node;
4
5
use Digia\GraphQL\Language\AST\Node\Behavior\DirectivesTrait;
6
use Digia\GraphQL\Language\AST\Node\Behavior\NameTrait;
7
use Digia\GraphQL\Language\AST\Node\Contract\TypeExtensionNodeInterface;
8
use Digia\GraphQL\Language\AST\NodeKindEnum;
9
10
class ScalarTypeExtensionNode extends AbstractNode implements TypeExtensionNodeInterface
11
{
12
13
    use NameTrait;
14
    use DirectivesTrait;
15
16
    /**
17
     * @var string
18
     */
19
    protected $kind = NodeKindEnum::SCALAR_TYPE_EXTENSION;
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function toArray(): array
25
    {
26
        return [
27
            'kind'       => $this->kind,
28
            'name'       => $this->getNameAsArray(),
29
            'directives' => $this->getDirectivesAsArray(),
30
            'loc'        => $this->getLocationAsArray(),
31
        ];
32
    }
33
}
34