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

AliasTrait::getAliasAsArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Language\AST\Node;
4
5
trait AliasTrait
6
{
7
8
    /**
9
     * @var NameNode|null
10
     */
11
    protected $alias;
12
13
    /**
14
     * @return NameNode|null
15
     */
16
    public function getAlias(): ?NameNode
17
    {
18
        return $this->alias;
19
    }
20
21
    /**
22
     * @return array|null
23
     */
24
    public function getAliasAsArray(): ?array
25
    {
26
        return null !== $this->alias ? $this->alias->toArray() : null;
27
    }
28
}
29