Completed
Push — master ( 4d2ac5...1a75da )
by Portey
03:12
created

Field::getAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Date: 23.11.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Parser\Ast;
9
10
11
class Field
12
{
13
    /** @var string */
14
    private $name;
15
16
    /** @var null|string */
17
    private $alias = null;
18
19 26
    public function __construct($name, $alias = null)
20
    {
21 26
        $this->name  = $name;
22 26
        $this->alias = $alias;
23 26
    }
24
25
    /**
26
     * @return string
27
     */
28 11
    public function getName()
29
    {
30 11
        return $this->name;
31
    }
32
33
    /**
34
     * @param string $name
35
     */
36
    public function setName($name)
37
    {
38
        $this->name = $name;
39
    }
40
41
    /**
42
     * @return null|string
43
     */
44 1
    public function getAlias()
45
    {
46 1
        return $this->alias;
47
    }
48
49
    /**
50
     * @param null|string $alias
51
     */
52
    public function setAlias($alias)
53
    {
54
        $this->alias = $alias;
55
    }
56
}