Completed
Push — master ( d7fcc6...aeb790 )
by Christoffer
02:03
created

OperationTypeDefinitionNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Methods

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