Field::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
ccs 7
cts 7
cp 1
cc 1
nc 1
nop 5
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
use Youshido\GraphQL\Parser\Ast\Interfaces\FieldInterface;
12
use Youshido\GraphQL\Parser\Location;
13
14
class Field extends AbstractAst implements FieldInterface
15
{
16
    use AstArgumentsTrait;
17
    use AstDirectivesTrait;
18
19
    /** @var string */
20
    private $name;
21
22
    /** @var null|string */
23
    private $alias = null;
24
25
    /**
26
     * @param string   $name
27
     * @param string   $alias
28
     * @param array    $arguments
29
     * @param array    $directives
30
     * @param Location $location
31
     */
32 69 View Code Duplication
    public function __construct($name, $alias, array $arguments, array $directives, Location $location)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
    {
34 69
        parent::__construct($location);
35
36 69
        $this->name      = $name;
37 69
        $this->alias     = $alias;
38 69
        $this->setArguments($arguments);
39 69
        $this->setDirectives($directives);
40 69
    }
41
42
    /**
43
     * @return string
44
     */
45 39
    public function getName()
46
    {
47 39
        return $this->name;
48
    }
49
50
    /**
51
     * @param string $name
52
     */
53 1
    public function setName($name)
54
    {
55 1
        $this->name = $name;
56 1
    }
57
58
    /**
59
     * @return null|string
60
     */
61 39
    public function getAlias()
62
    {
63 39
        return $this->alias;
64
    }
65
66
    /**
67
     * @param null|string $alias
68
     */
69 1
    public function setAlias($alias)
70
    {
71 1
        $this->alias = $alias;
72 1
    }
73
74
    public function hasFields()
75
    {
76
        return false;
77
    }
78
79
    public function getFields()
80
    {
81
        return [];
82
    }
83
84
}