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

OperationTypeDefinitionNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOperation() 0 3 1
A toArray() 0 7 1
1
<?php
2
3
namespace Digia\GraphQL\Language\AST\Node;
4
5
use Digia\GraphQL\Language\AST\Node\Behavior\TypeTrait;
6
use Digia\GraphQL\Language\AST\Node\Contract\DefinitionNodeInterface;
7
use Digia\GraphQL\Language\AST\NodeKindEnum;
8
9
class OperationTypeDefinitionNode extends AbstractNode implements DefinitionNodeInterface
10
{
11
12
    use TypeTrait;
13
14
    /**
15
     * @var string
16
     */
17
    protected $kind = NodeKindEnum::OPERATION_TYPE_DEFINITION;
18
19
    /**
20
     * @var string
21
     */
22
    protected $operation;
23
24
    /**
25
     * @return string
26
     */
27
    public function getOperation(): string
28
    {
29
        return $this->operation;
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35
    public function toArray(): array
36
    {
37
        return [
38
            'kind'      => $this->kind,
39
            'operation' => $this->operation,
40
            'type'      => $this->getTypeAsArray(),
41
            'loc'       => $this->getLocationAsArray(),
42
        ];
43
    }
44
}
45