1 | <?php declare(strict_types=1); |
||
17 | class Project |
||
18 | { |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $id; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $name; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $description; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $repositoryUrl; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $repositoryType; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | private $vendorName; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $packageName; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | private $branch; |
||
58 | |||
59 | /** |
||
60 | * @var \DateTime |
||
61 | */ |
||
62 | private $createdAt; |
||
63 | |||
64 | /** |
||
65 | * @var \DateTime |
||
66 | */ |
||
67 | private $updatedAt; |
||
68 | |||
69 | /** |
||
70 | * @var \DateTime |
||
71 | */ |
||
72 | private $deletedAt; |
||
73 | |||
74 | /** |
||
75 | * @var Collection |
||
76 | */ |
||
77 | private $dependencies; |
||
78 | |||
79 | /** |
||
80 | * Constructor. |
||
81 | */ |
||
82 | public function __construct() |
||
86 | |||
87 | /** |
||
88 | * Get id. |
||
89 | * |
||
90 | * @return int |
||
91 | */ |
||
92 | public function getId(): int |
||
96 | |||
97 | /** |
||
98 | * Set name. |
||
99 | * |
||
100 | * @param string $name |
||
101 | */ |
||
102 | public function setName(string $name) |
||
103 | { |
||
104 | $this->name = $name; |
||
105 | } |
||
106 | |||
107 | /** |
||
108 | * Get name. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getName(): string |
||
113 | { |
||
114 | return $this->name; |
||
115 | } |
||
116 | |||
117 | /** |
||
118 | * Set description. |
||
119 | * |
||
120 | * @param string $description |
||
121 | */ |
||
122 | public function setDescription(string $description) |
||
126 | |||
127 | /** |
||
128 | * Get description. |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | public function getDescription(): string |
||
136 | |||
137 | /** |
||
138 | * Set repositoryUrl. |
||
139 | * |
||
140 | * @param string $repositoryUrl |
||
141 | */ |
||
142 | public function setRepositoryUrl(string $repositoryUrl) |
||
146 | |||
147 | /** |
||
148 | * Get repositoryUrl. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | public function getRepositoryUrl(): string |
||
156 | |||
157 | /** |
||
158 | * Add dependencies. |
||
159 | * |
||
160 | * @TODO: Refactor |
||
161 | * |
||
162 | * @param Dependency $dependency |
||
163 | */ |
||
164 | public function addDependency(Dependency $dependency) |
||
180 | |||
181 | /** |
||
182 | * Remove dependencies. |
||
183 | * |
||
184 | * @param Dependency $dependency |
||
185 | */ |
||
186 | public function removeDependency(Dependency $dependency) |
||
190 | |||
191 | /** |
||
192 | * Get dependencies. |
||
193 | * |
||
194 | * @return Collection |
||
195 | */ |
||
196 | public function getDependencies(): Collection |
||
200 | |||
201 | /** |
||
202 | * Set repositoryType. |
||
203 | * |
||
204 | * @param string $repositoryType |
||
205 | */ |
||
206 | public function setRepositoryType(string $repositoryType) |
||
210 | |||
211 | /** |
||
212 | * Get repositoryType. |
||
213 | * |
||
214 | * @return string |
||
215 | */ |
||
216 | public function getRepositoryType(): string |
||
220 | |||
221 | /** |
||
222 | * Set vendorName. |
||
223 | * |
||
224 | * @param string $vendorName |
||
225 | */ |
||
226 | public function setVendorName($vendorName) |
||
230 | |||
231 | /** |
||
232 | * Get vendorName. |
||
233 | * |
||
234 | * @return string |
||
235 | */ |
||
236 | public function getVendorName(): string |
||
240 | |||
241 | /** |
||
242 | * Set packageName. |
||
243 | * |
||
244 | * @param string $packageName |
||
245 | */ |
||
246 | public function setPackageName(string $packageName) |
||
250 | |||
251 | /** |
||
252 | * Get packageName. |
||
253 | * |
||
254 | * @return string |
||
255 | */ |
||
256 | public function getPackageName(): string |
||
260 | |||
261 | /** |
||
262 | * Set branch. |
||
263 | * |
||
264 | * @param string $branch |
||
265 | */ |
||
266 | public function setBranch(string $branch) |
||
270 | |||
271 | /** |
||
272 | * Get branch. |
||
273 | * |
||
274 | * @return string |
||
275 | */ |
||
276 | public function getBranch(): string |
||
280 | |||
281 | /** |
||
282 | * Get the total stats. |
||
283 | * |
||
284 | * @todo: Refactor into a service |
||
285 | * |
||
286 | * @return array |
||
287 | */ |
||
288 | public function getTotalStats(): array |
||
298 | |||
299 | /** |
||
300 | * Set createdAt. |
||
301 | * |
||
302 | * @param \DateTimeInterface $createdAt |
||
303 | */ |
||
304 | public function setCreatedAt(\DateTimeInterface $createdAt) |
||
308 | |||
309 | /** |
||
310 | * Get createdAt. |
||
311 | * |
||
312 | * @return \DateTimeInterface |
||
313 | */ |
||
314 | public function getCreatedAt(): \DateTimeInterface |
||
318 | |||
319 | /** |
||
320 | * Set updatedAt. |
||
321 | * |
||
322 | * @param \DateTimeInterface $updatedAt |
||
323 | * |
||
324 | * @return Project |
||
325 | */ |
||
326 | public function setUpdatedAt(\DateTimeInterface $updatedAt) |
||
330 | |||
331 | /** |
||
332 | * Get updatedAt. |
||
333 | * |
||
334 | * @return \DateTimeInterface |
||
335 | */ |
||
336 | public function getUpdatedAt(): \DateTimeInterface |
||
340 | |||
341 | /** |
||
342 | * Set deletedAt. |
||
343 | * |
||
344 | * @param \DateTimeInterface $deletedAt |
||
345 | */ |
||
346 | public function setDeletedAt(\DateTimeInterface $deletedAt = null) |
||
350 | |||
351 | /** |
||
352 | * Get deletedAt. |
||
353 | * |
||
354 | * @return \DateTimeInterface|null |
||
355 | */ |
||
356 | public function getDeletedAt(): ?\DateTimeInterface |
||
360 | } |
||
361 |
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 given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.