Fragment::setUsed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
cc 1
nc 1
nop 1
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\Location;
12
13
class Fragment extends AbstractAst
14
{
15
16
    use AstDirectivesTrait;
17
18
    protected $name;
19
20
    protected $model;
21
22
    /** @var Field[]|Query[] */
23
    protected $fields;
24
25
    /** @var bool */
26
    private $used = false;
27
28
    /**
29
     * @param string          $name
30
     * @param string          $model
31
     * @param array           $directives
32
     * @param Field[]|Query[] $fields
33
     * @param Location        $location
34
     */
35 14
    public function __construct($name, $model, array $directives, array $fields, Location $location)
36
    {
37 14
        parent::__construct($location);
38
39 14
        $this->name   = $name;
40 14
        $this->model  = $model;
41 14
        $this->fields = $fields;
0 ignored issues
show
Documentation Bug introduced by
It seems like $fields of type array<integer,object<You...phQL\Parser\Ast\Query>> is incompatible with the declared type array<integer,object<You...phQL\Parser\Ast\Query>> of property $fields.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
42 14
        $this->setDirectives($directives);
43 14
    }
44
45
    /**
46
     * @return boolean
47
     */
48 10
    public function isUsed()
49
    {
50 10
        return $this->used;
51
    }
52
53
    /**
54
     * @param boolean $used
55
     */
56 10
    public function setUsed($used)
57
    {
58 10
        $this->used = $used;
59 10
    }
60
61
    /**
62
     * @return mixed
63
     */
64 12
    public function getName()
65
    {
66 12
        return $this->name;
67
    }
68
69
    /**
70
     * @param mixed $name
71
     */
72 1
    public function setName($name)
73
    {
74 1
        $this->name = $name;
75 1
    }
76
77
    /**
78
     * @return mixed
79
     */
80 9
    public function getModel()
81
    {
82 9
        return $this->model;
83
    }
84
85
    /**
86
     * @param mixed $model
87
     */
88 1
    public function setModel($model)
89
    {
90 1
        $this->model = $model;
91 1
    }
92
93
    /**
94
     * @return Field[]|Query[]
95
     */
96 8
    public function getFields()
97
    {
98 8
        return $this->fields;
99
    }
100
101
    /**
102
     * @param Field[]|Query[] $fields
103
     */
104 1
    public function setFields($fields)
105
    {
106 1
        $this->fields = $fields;
0 ignored issues
show
Documentation Bug introduced by
It seems like $fields of type array<integer,object<You...phQL\Parser\Ast\Query>> is incompatible with the declared type array<integer,object<You...phQL\Parser\Ast\Query>> of property $fields.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
107
    }
108
}