Completed
Pull Request — master (#19)
by Christoffer
02:01
created

DescriptionTrait::getDescriptionValue()   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\Behavior;
4
5
use Digia\GraphQL\Language\AST\Node\StringValueNode;
6
7
trait DescriptionTrait
8
{
9
10
    /**
11
     * @var StringValueNode|null
12
     */
13
    protected $description;
14
15
    /**
16
     * @return StringValueNode|null
17
     */
18
    public function getDescription(): ?StringValueNode
19
    {
20
        return $this->description;
21
    }
22
23
    /**
24
     * @return null|string
25
     */
26
    public function getDescriptionValue(): ?string
27
    {
28
        return null !== $this->description ? $this->description->getValue() : null;
29
    }
30
31
    /**
32
     * @return array|null
33
     */
34
    public function getDescriptionAsArray(): ?array
35
    {
36
        return null !== $this->description ? $this->description->toArray() : null;
37
    }
38
}
39