1 | <?php |
||
11 | class Query |
||
12 | { |
||
13 | |||
14 | /** @var string */ |
||
15 | protected $name; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected $alias; |
||
19 | |||
20 | /** @var Argument[] */ |
||
21 | protected $arguments; |
||
22 | |||
23 | /** @var Field[]|Query[] */ |
||
24 | protected $fields; |
||
25 | |||
26 | 51 | public function __construct($name, $alias = null, $arguments = [], $fields = []) |
|
33 | |||
34 | 28 | public function getName() |
|
38 | |||
39 | 1 | public function hasArguments() |
|
43 | |||
44 | /** |
||
45 | * @return Argument[] |
||
46 | */ |
||
47 | 29 | public function getArguments() |
|
51 | |||
52 | /** |
||
53 | * @param $arguments Argument[] |
||
54 | */ |
||
55 | 1 | public function setArguments($arguments) |
|
56 | { |
||
57 | 1 | $this->arguments = $arguments; |
|
58 | 1 | } |
|
59 | |||
60 | 5 | public function addArgument(Argument $argument) |
|
64 | |||
65 | 3 | public function getKeyValueArguments() |
|
66 | { |
||
67 | 3 | $arguments = []; |
|
68 | |||
69 | 3 | foreach ($this->getArguments() as $argument) { |
|
70 | 3 | $arguments[$argument->getName()] = $argument->getValue()->getValue(); |
|
71 | } |
||
72 | |||
73 | 3 | return $arguments; |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return Field[]|Query[]|FragmentInterface[] |
||
78 | */ |
||
79 | 25 | public function getFields() |
|
83 | |||
84 | /** |
||
85 | * @return bool |
||
86 | */ |
||
87 | 23 | public function hasFields() |
|
91 | |||
92 | /** |
||
93 | * @param Field[]|Query[] $fields |
||
94 | */ |
||
95 | 1 | public function setFields($fields) |
|
96 | { |
||
97 | 1 | $this->fields = $fields; |
|
|
|||
98 | 1 | } |
|
99 | |||
100 | 28 | public function getAlias() |
|
101 | { |
||
102 | 28 | return $this->alias; |
|
103 | } |
||
104 | |||
105 | public function hasField($name, $deep = false) |
||
121 | |||
122 | } |
||
123 |
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..