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

OperationTypeDefinitionNode::getOperation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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