Completed
Push — master ( af419f...577784 )
by Portey
06:50
created

Fragment   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 44%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 9
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 91
ccs 11
cts 25
cp 0.44
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isUsed() 0 4 1
A setUsed() 0 4 1
A setName() 0 4 1
A setModel() 0 4 1
A setFields() 0 4 1
A getName() 0 4 1
A getModel() 0 4 1
A getFields() 0 4 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 Fragment
12
{
13
14
    protected $name;
15
16
    protected $model;
17
18
    /** @var Field[]|Query[] */
19
    protected $fields;
20
21
    /** @var bool */
22
    private $used = false;
23
24
    /**
25
     * Fragment constructor.
26
     *
27
     * @param                 $name
28
     * @param                 $model
29
     * @param Field[]|Query[] $children
30
     */
31 3
    public function __construct($name, $model, $children)
32
    {
33 3
        $this->name   = $name;
34 3
        $this->model  = $model;
35 3
        $this->fields = $children;
0 ignored issues
show
Documentation Bug introduced by
It seems like $children 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...
36 3
    }
37
38
    /**
39
     * @return boolean
40
     */
41
    public function isUsed()
42
    {
43
        return $this->used;
44
    }
45
46
    /**
47
     * @param boolean $used
48
     */
49
    public function setUsed($used)
50
    {
51
        $this->used = $used;
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57 1
    public function getName()
58
    {
59 1
        return $this->name;
60
    }
61
62
    /**
63
     * @param mixed $name
64
     */
65
    public function setName($name)
66
    {
67
        $this->name = $name;
68
    }
69
70
    /**
71
     * @return mixed
72
     */
73 1
    public function getModel()
74
    {
75 1
        return $this->model;
76
    }
77
78
    /**
79
     * @param mixed $model
80
     */
81
    public function setModel($model)
82
    {
83
        $this->model = $model;
84
    }
85
86
    /**
87
     * @return Field[]|Query[]
88
     */
89 1
    public function getFields()
90
    {
91 1
        return $this->fields;
92
    }
93
94
    /**
95
     * @param Field[]|Query[] $fields
96
     */
97
    public function setFields($fields)
98
    {
99
        $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...
100
    }
101
}