Completed
Pull Request — master (#20)
by Christoffer
02:40 queued 53s
created

SelectionSetTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSelectionSet() 0 3 1
A getSelectionSetAsArray() 0 3 2
1
<?php
2
3
namespace Digia\GraphQL\Language\AST\Node;
4
5
trait SelectionSetTrait
6
{
7
8
    /**
9
     * @var SelectionSetNode|null
10
     */
11
    protected $selectionSet;
12
13
    /**
14
     * @return SelectionSetNode|null
15
     */
16
    public function getSelectionSet(): ?SelectionSetNode
17
    {
18
        return $this->selectionSet;
19
    }
20
21
    /**
22
     * @return array|null
23
     */
24
    public function getSelectionSetAsArray(): ?array
25
    {
26
        return null !== $this->selectionSet ? $this->selectionSet->toArray() : null;
27
    }
28
}
29