1 | <?php |
||
8 | class PropertyMetadata extends BasePropertyMetadata |
||
9 | { |
||
10 | /** |
||
11 | * @var string|null |
||
12 | */ |
||
13 | private $type; |
||
14 | |||
15 | /** |
||
16 | * @var bool |
||
17 | */ |
||
18 | private $puttable = false; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $excluded = false; |
||
24 | |||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | private $postable = false; |
||
29 | |||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $includable = false; |
||
34 | |||
35 | /** |
||
36 | * @var string[]|null |
||
37 | */ |
||
38 | private $includablePaths; |
||
39 | |||
40 | /** |
||
41 | * @var bool |
||
42 | */ |
||
43 | private $subResource = false; |
||
44 | |||
45 | /** |
||
46 | * @var bool |
||
47 | */ |
||
48 | private $association = false; |
||
49 | |||
50 | /** |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $collection = false; |
||
54 | |||
55 | /** |
||
56 | * @var string|null |
||
57 | */ |
||
58 | private $subResourcePath; |
||
59 | |||
60 | /** |
||
61 | * @var Right|null |
||
62 | */ |
||
63 | private $subResourceListRight; |
||
64 | |||
65 | /** |
||
66 | * @var Right|null |
||
67 | */ |
||
68 | private $subResourcePostRight; |
||
69 | |||
70 | /** |
||
71 | * @var Right|null |
||
72 | */ |
||
73 | private $subResourcePutRight; |
||
74 | |||
75 | /** |
||
76 | * @var Right|null |
||
77 | */ |
||
78 | private $subResourceDeleteRight; |
||
79 | |||
80 | /** |
||
81 | * @var string|null |
||
82 | */ |
||
83 | private $targetClass; |
||
84 | |||
85 | /** |
||
86 | * @return boolean |
||
87 | */ |
||
88 | 2 | public function isPuttable() |
|
92 | |||
93 | /** |
||
94 | * @param boolean $puttable |
||
95 | */ |
||
96 | 20 | public function setPuttable($puttable) |
|
100 | |||
101 | /** |
||
102 | * @return boolean |
||
103 | */ |
||
104 | public function isPostable() |
||
108 | |||
109 | /** |
||
110 | * @param boolean $postable |
||
111 | */ |
||
112 | public function setPostable($postable) |
||
116 | |||
117 | /** |
||
118 | * @return boolean |
||
119 | */ |
||
120 | 20 | public function isIncludable() |
|
124 | |||
125 | /** |
||
126 | * @param boolean $includable |
||
127 | */ |
||
128 | 20 | public function setIncludable($includable) |
|
132 | |||
133 | /** |
||
134 | * @return boolean |
||
135 | */ |
||
136 | 4 | public function isSubResource() |
|
140 | |||
141 | /** |
||
142 | * @param boolean $subResource |
||
143 | */ |
||
144 | 20 | public function setSubResource($subResource) |
|
148 | |||
149 | /** |
||
150 | * @return Right|null |
||
151 | */ |
||
152 | 6 | public function getSubResourceListRight() |
|
156 | |||
157 | /** |
||
158 | * @param Right|null $subResourceListRight |
||
159 | */ |
||
160 | public function setSubResourceListRight($subResourceListRight) |
||
164 | |||
165 | /** |
||
166 | * @return Right|null |
||
167 | */ |
||
168 | 2 | public function getSubResourcePostRight() |
|
172 | |||
173 | /** |
||
174 | * @param Right|null $subResourcePostRight |
||
175 | */ |
||
176 | public function setSubResourcePostRight($subResourcePostRight) |
||
180 | |||
181 | /** |
||
182 | * @param Right|null $subResourcePutRight |
||
183 | */ |
||
184 | 20 | public function setSubResourcePutRight($subResourcePutRight) |
|
188 | |||
189 | /** |
||
190 | * @return Right|null |
||
191 | */ |
||
192 | 4 | public function getSubResourcePutRight() |
|
196 | |||
197 | /** |
||
198 | * @param Right|null $subResourceDeleteRight |
||
199 | */ |
||
200 | 20 | public function setSubResourceDeleteRight($subResourceDeleteRight) |
|
204 | |||
205 | /** |
||
206 | * @return Right|null |
||
207 | */ |
||
208 | 4 | public function getSubResourceDeleteRight() |
|
212 | |||
213 | /** |
||
214 | * @return null|string |
||
215 | */ |
||
216 | public function getTargetClass() |
||
220 | |||
221 | /** |
||
222 | * @param null|string $targetClass |
||
223 | */ |
||
224 | 22 | public function setTargetClass($targetClass) |
|
228 | |||
229 | /** |
||
230 | * @return null|string |
||
231 | */ |
||
232 | 2 | public function getSubResourcePath() |
|
236 | |||
237 | /** |
||
238 | * @param null|string $subResourcePath |
||
239 | */ |
||
240 | public function setSubResourcePath($subResourcePath) |
||
244 | |||
245 | /** |
||
246 | * @return bool |
||
247 | */ |
||
248 | 20 | public function isExcluded(): bool |
|
252 | |||
253 | /** |
||
254 | * @param bool $excluded |
||
255 | */ |
||
256 | 20 | public function setExcluded(bool $excluded) |
|
260 | |||
261 | /** |
||
262 | * @return null|\string[] |
||
263 | */ |
||
264 | 8 | public function getIncludablePaths(): ?array |
|
268 | |||
269 | /** |
||
270 | * @param null|\string[] $includablePaths |
||
271 | */ |
||
272 | 20 | public function setIncludablePaths(?array $includablePaths) |
|
276 | |||
277 | /** |
||
278 | * @return bool |
||
279 | */ |
||
280 | 20 | public function isAssociation(): bool |
|
284 | |||
285 | /** |
||
286 | * @param bool $association |
||
287 | */ |
||
288 | 22 | public function setAssociation(bool $association) |
|
292 | |||
293 | /** |
||
294 | * @return bool |
||
295 | */ |
||
296 | 2 | public function isCollection(): bool |
|
300 | |||
301 | /** |
||
302 | * @param bool $collection |
||
303 | */ |
||
304 | 22 | public function setCollection(bool $collection) |
|
308 | |||
309 | 20 | public function getType(): ?string |
|
313 | |||
314 | 32 | public function setType(?string $type) |
|
318 | } |
||
319 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.