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

ScalarTypeExtensionNode::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
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\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