This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types = 1); |
||
4 | |||
5 | namespace Speicher210\KontaktIO\Model; |
||
6 | |||
7 | use JMS\Serializer\Annotation as JMS; |
||
8 | |||
9 | /** |
||
10 | * Model representing a device. |
||
11 | */ |
||
12 | final class Device |
||
13 | { |
||
14 | public const PROXIMITY_IMMEDIATE = 'IMMEDIATE'; |
||
15 | public const PROXIMITY_NEAR = 'NEAR'; |
||
16 | public const PROXIMITY_FAR = 'FAR'; |
||
17 | |||
18 | public const DEVICE_TYPE_BEACON = 'BEACON'; |
||
19 | public const DEVICE_TYPE_CLOUD_BEACON = 'CLOUD_BEACON'; |
||
20 | |||
21 | public const PROFILE_IBEACON = 'IBEACON'; |
||
22 | public const PROFILE_EDDYSTONE = 'EDDYSTONE'; |
||
23 | |||
24 | public const PACKET_IBEACON = 'IBEACON'; |
||
25 | public const PACKET_EDDYSTONE_URL = 'EDDYSTONE_URL'; |
||
26 | |||
27 | public const SPECIFICATION_STANDARD = 'STANDARD'; |
||
28 | public const SPECIFICATION_SENSOR = 'SENSOR'; |
||
29 | public const SPECIFICATION_TOUGH = 'TOUGH'; |
||
30 | |||
31 | public const MODEL_CARD_BEACON = 'CARD_BEACON'; |
||
32 | public const MODEL_CLOUD_BEACON = 'CLOUD_BEACON'; |
||
33 | public const MODEL_EXTERNAL = 'EXTERNAL'; |
||
34 | public const MODEL_GATEWAY = 'GATEWAY'; |
||
35 | public const MODEL_SENSOR_BEACON = 'SENSOR_BEACON'; |
||
36 | public const MODEL_SMART_BEACON = 'SMART_BEACON'; |
||
37 | public const MODEL_USB_BEACON = 'USB_BEACON'; |
||
38 | |||
39 | /** |
||
40 | * Device ID. |
||
41 | * |
||
42 | * This is an UUID. |
||
43 | * |
||
44 | * @var string |
||
45 | * |
||
46 | * @JMS\Type("string") |
||
47 | * @JMS\SerializedName("id") |
||
48 | */ |
||
49 | private $id; |
||
50 | |||
51 | /** |
||
52 | * Device unique ID. |
||
53 | * |
||
54 | * @var string |
||
55 | * |
||
56 | * @JMS\Type("string") |
||
57 | * @JMS\SerializedName("uniqueId") |
||
58 | */ |
||
59 | private $uniqueId; |
||
60 | |||
61 | /** |
||
62 | * Eddystone namespace. |
||
63 | * |
||
64 | * @var string |
||
65 | * |
||
66 | * @JMS\Type("string") |
||
67 | * @JMS\SerializedName("namespace") |
||
68 | */ |
||
69 | private $namespace; |
||
70 | |||
71 | /** |
||
72 | * Eddystone ID. |
||
73 | * |
||
74 | * @var string |
||
75 | * |
||
76 | * @JMS\Type("string") |
||
77 | * @JMS\SerializedName("instanceId") |
||
78 | */ |
||
79 | private $instanceId; |
||
80 | |||
81 | /** |
||
82 | * Device type. |
||
83 | * |
||
84 | * @var string |
||
85 | * |
||
86 | * @JMS\Type("string") |
||
87 | * @JMS\SerializedName("deviceType") |
||
88 | */ |
||
89 | private $deviceType; |
||
90 | |||
91 | /** |
||
92 | * Specification. |
||
93 | * |
||
94 | * @var string |
||
95 | * |
||
96 | * @JMS\Type("string") |
||
97 | * @JMS\SerializedName("specification") |
||
98 | */ |
||
99 | private $specification; |
||
100 | |||
101 | /** |
||
102 | * Proximity UUID. |
||
103 | * |
||
104 | * The UUID of the device. |
||
105 | * |
||
106 | * @var string |
||
107 | * |
||
108 | * @JMS\Type("string") |
||
109 | * @JMS\SerializedName("proximity") |
||
110 | */ |
||
111 | private $proximity; |
||
112 | |||
113 | /** |
||
114 | * Major. |
||
115 | * |
||
116 | * @var integer |
||
117 | * |
||
118 | * @JMS\Type("integer") |
||
119 | * @JMS\SerializedName("major") |
||
120 | */ |
||
121 | private $major; |
||
122 | |||
123 | /** |
||
124 | * Minor. |
||
125 | * |
||
126 | * @var integer |
||
127 | * |
||
128 | * @JMS\Type("integer") |
||
129 | * @JMS\SerializedName("minor") |
||
130 | */ |
||
131 | private $minor; |
||
132 | |||
133 | /** |
||
134 | * Device name. |
||
135 | * |
||
136 | * @var string |
||
137 | * |
||
138 | * @JMS\Type("string") |
||
139 | * @JMS\SerializedName("name") |
||
140 | */ |
||
141 | private $name; |
||
142 | |||
143 | /** |
||
144 | * Device alias. |
||
145 | * |
||
146 | * @var string |
||
147 | * |
||
148 | * @JMS\Type("string") |
||
149 | * @JMS\SerializedName("alias") |
||
150 | */ |
||
151 | private $alias; |
||
152 | |||
153 | /** |
||
154 | * The model. |
||
155 | * |
||
156 | * @var string |
||
157 | * |
||
158 | * @JMS\Type("string") |
||
159 | * @JMS\SerializedName("model") |
||
160 | */ |
||
161 | private $model; |
||
162 | |||
163 | /** |
||
164 | * Advertising interval range (20 - 10240 milliseconds). |
||
165 | * |
||
166 | * @var integer |
||
167 | * |
||
168 | * @JMS\Type("integer") |
||
169 | * @JMS\SerializedName("interval") |
||
170 | */ |
||
171 | private $interval; |
||
172 | |||
173 | /** |
||
174 | * Transmission power (0 - 7). |
||
175 | * |
||
176 | * @var integer |
||
177 | * |
||
178 | * @JMS\Type("integer") |
||
179 | * @JMS\SerializedName("txPower") |
||
180 | */ |
||
181 | private $txPower; |
||
182 | |||
183 | /** |
||
184 | * Device URL. |
||
185 | * |
||
186 | * @var string |
||
187 | * |
||
188 | * @JMS\Type("string") |
||
189 | * @JMS\SerializedName("url") |
||
190 | */ |
||
191 | private $url; |
||
192 | |||
193 | /** |
||
194 | * Firmware version of the device |
||
195 | * |
||
196 | * @var string |
||
197 | * |
||
198 | * @JMS\Type("string") |
||
199 | * @JMS\SerializedName("firmware") |
||
200 | */ |
||
201 | private $firmware; |
||
202 | |||
203 | /** |
||
204 | * Device profile. |
||
205 | * |
||
206 | * @var array |
||
207 | * |
||
208 | * @JMS\Type("array") |
||
209 | * @JMS\SerializedName("profiles") |
||
210 | */ |
||
211 | private $profiles; |
||
212 | |||
213 | /** |
||
214 | * @param string $uniqueId Device unique ID. |
||
215 | */ |
||
216 | public function __construct(string $uniqueId) |
||
217 | { |
||
218 | $this->uniqueId = $uniqueId; |
||
219 | } |
||
220 | |||
221 | /** |
||
222 | * Get the ID. |
||
223 | * |
||
224 | * @return string |
||
225 | */ |
||
226 | public function id() |
||
227 | { |
||
228 | return $this->id; |
||
229 | } |
||
230 | |||
231 | /** |
||
232 | * Set the ID. |
||
233 | * |
||
234 | * @param string $id |
||
235 | * @return Device |
||
236 | */ |
||
237 | public function setId(string $id) |
||
238 | { |
||
239 | $this->id = $id; |
||
240 | |||
241 | return $this; |
||
242 | } |
||
243 | |||
244 | /** |
||
245 | * Get the unique ID. |
||
246 | * |
||
247 | * @return string |
||
248 | */ |
||
249 | public function uniqueId(): string |
||
250 | { |
||
251 | return $this->uniqueId; |
||
252 | } |
||
253 | |||
254 | /** |
||
255 | * Get the namespace. |
||
256 | * |
||
257 | * @return string |
||
258 | */ |
||
259 | public function namespace() |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
260 | { |
||
261 | return $this->namespace; |
||
0 ignored issues
–
show
The visibility should be declared for property
$this .
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using class A {
var $property;
}
the property is implicitly global. To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2. ![]() |
|||
262 | } |
||
263 | |||
264 | /** |
||
265 | * Set the namespace. |
||
266 | * |
||
267 | * @param string $namespace The namespace. |
||
268 | * @return Device |
||
269 | */ |
||
270 | public function setNamespace($namespace) |
||
271 | { |
||
272 | $this->namespace = $namespace; |
||
273 | |||
274 | return $this; |
||
275 | } |
||
276 | |||
277 | /** |
||
278 | * Get the instance ID. |
||
279 | * |
||
280 | * @return string |
||
281 | */ |
||
282 | public function instanceId() |
||
283 | { |
||
284 | return $this->instanceId; |
||
285 | } |
||
286 | |||
287 | /** |
||
288 | * Set the instance ID. |
||
289 | * |
||
290 | * @param string $instanceId The instance ID. |
||
291 | * @return Device |
||
292 | */ |
||
293 | public function setInstanceId($instanceId) |
||
294 | { |
||
295 | $this->instanceId = $instanceId; |
||
296 | |||
297 | return $this; |
||
298 | } |
||
299 | |||
300 | /** |
||
301 | * Get the device type. |
||
302 | * |
||
303 | * @return string |
||
304 | */ |
||
305 | public function deviceType() |
||
306 | { |
||
307 | return $this->deviceType; |
||
308 | } |
||
309 | |||
310 | /** |
||
311 | * Set the device type. |
||
312 | * |
||
313 | * @param string $deviceType The device type. |
||
314 | * @return Device |
||
315 | */ |
||
316 | public function setDeviceType($deviceType) |
||
317 | { |
||
318 | $this->deviceType = $deviceType; |
||
319 | |||
320 | return $this; |
||
321 | } |
||
322 | |||
323 | /** |
||
324 | * Get the specifications. |
||
325 | * |
||
326 | * @return string |
||
327 | */ |
||
328 | public function specification() |
||
329 | { |
||
330 | return $this->specification; |
||
331 | } |
||
332 | |||
333 | /** |
||
334 | * Set the specifications. |
||
335 | * |
||
336 | * @param string $specification The specifications. |
||
337 | * @return Device |
||
338 | */ |
||
339 | public function setSpecification($specification) |
||
340 | { |
||
341 | $this->specification = $specification; |
||
342 | |||
343 | return $this; |
||
344 | } |
||
345 | |||
346 | /** |
||
347 | * Get the proximity. |
||
348 | * |
||
349 | * @return string |
||
350 | */ |
||
351 | public function proximity(): string |
||
352 | { |
||
353 | return $this->proximity; |
||
354 | } |
||
355 | |||
356 | /** |
||
357 | * Set the proximity UUID. |
||
358 | * |
||
359 | * @param string $proximity The proximity UUID. |
||
360 | * @return Device |
||
361 | */ |
||
362 | public function setProximity(string $proximity) |
||
363 | { |
||
364 | $this->proximity = $proximity; |
||
365 | |||
366 | return $this; |
||
367 | } |
||
368 | |||
369 | /** |
||
370 | * Get the major. |
||
371 | * |
||
372 | * @return integer |
||
373 | */ |
||
374 | public function major(): int |
||
375 | { |
||
376 | return $this->major; |
||
377 | } |
||
378 | |||
379 | /** |
||
380 | * Set the major. |
||
381 | * |
||
382 | * @param integer $major The major. |
||
383 | * @return Device |
||
384 | */ |
||
385 | public function setMajor(int $major) |
||
386 | { |
||
387 | $this->major = $major; |
||
388 | |||
389 | return $this; |
||
390 | } |
||
391 | |||
392 | /** |
||
393 | * Get the minor. |
||
394 | * |
||
395 | * @return integer |
||
396 | */ |
||
397 | public function minor(): int |
||
398 | { |
||
399 | return $this->minor; |
||
400 | } |
||
401 | |||
402 | /** |
||
403 | * Set the minor. |
||
404 | * |
||
405 | * @param integer $minor The minor. |
||
406 | * @return Device |
||
407 | */ |
||
408 | public function setMinor(int $minor) |
||
409 | { |
||
410 | $this->minor = $minor; |
||
411 | |||
412 | return $this; |
||
413 | } |
||
414 | |||
415 | /** |
||
416 | * Get the name. |
||
417 | * |
||
418 | * @return string |
||
419 | */ |
||
420 | public function name(): string |
||
421 | { |
||
422 | return $this->name; |
||
423 | } |
||
424 | |||
425 | /** |
||
426 | * Set the name. |
||
427 | * |
||
428 | * @param string $name The name. |
||
429 | * @return Device |
||
430 | */ |
||
431 | public function setName($name) |
||
432 | { |
||
433 | $this->name = $name; |
||
434 | |||
435 | return $this; |
||
436 | } |
||
437 | |||
438 | /** |
||
439 | * Get the alias. |
||
440 | * |
||
441 | * @return string |
||
442 | */ |
||
443 | public function alias(): ?string |
||
444 | { |
||
445 | return $this->alias; |
||
446 | } |
||
447 | |||
448 | /** |
||
449 | * Set the alias. |
||
450 | * |
||
451 | * @param string $alias The alias. |
||
452 | * @return Device |
||
453 | */ |
||
454 | public function setAlias(?string $alias) |
||
455 | { |
||
456 | $this->alias = $alias; |
||
457 | |||
458 | return $this; |
||
459 | } |
||
460 | |||
461 | /** |
||
462 | * Get the model. |
||
463 | * |
||
464 | * @return string |
||
465 | */ |
||
466 | public function model(): string |
||
467 | { |
||
468 | return $this->model; |
||
469 | } |
||
470 | |||
471 | /** |
||
472 | * Set the model. |
||
473 | * |
||
474 | * @param string $model |
||
475 | * @return Device |
||
476 | */ |
||
477 | public function setModel(string $model): Device |
||
478 | { |
||
479 | $this->model = $model; |
||
480 | return $this; |
||
481 | } |
||
482 | |||
483 | /** |
||
484 | * Get the broadcast interval in milliseconds. |
||
485 | * |
||
486 | * @return integer |
||
487 | */ |
||
488 | public function interval(): int |
||
489 | { |
||
490 | return $this->interval; |
||
491 | } |
||
492 | |||
493 | /** |
||
494 | * Set the broadcast interval. |
||
495 | * |
||
496 | * @param integer $interval The interval in milliseconds. |
||
497 | * @return Device |
||
498 | */ |
||
499 | public function setInterval(int $interval) |
||
500 | { |
||
501 | $this->interval = $interval; |
||
502 | |||
503 | return $this; |
||
504 | } |
||
505 | |||
506 | /** |
||
507 | * Get the TX power. |
||
508 | * |
||
509 | * @return integer |
||
510 | */ |
||
511 | public function txPower(): int |
||
512 | { |
||
513 | return $this->txPower; |
||
514 | } |
||
515 | |||
516 | /** |
||
517 | * Set the TX power. |
||
518 | * |
||
519 | * @param integer $txPower |
||
520 | * @return Device |
||
521 | */ |
||
522 | public function setTxPower($txPower) |
||
523 | { |
||
524 | $this->txPower = $txPower; |
||
525 | |||
526 | return $this; |
||
527 | } |
||
528 | |||
529 | /** |
||
530 | * Get the URL. |
||
531 | * |
||
532 | * @return string |
||
533 | */ |
||
534 | public function url(): ?string |
||
535 | { |
||
536 | return $this->url; |
||
537 | } |
||
538 | |||
539 | /** |
||
540 | * Set the URL. |
||
541 | * |
||
542 | * @param string $url The URL. |
||
543 | * @return Device |
||
544 | */ |
||
545 | public function setUrl(?string $url) |
||
546 | { |
||
547 | $this->url = $url; |
||
548 | |||
549 | return $this; |
||
550 | } |
||
551 | |||
552 | /** |
||
553 | * Get the firmware version. |
||
554 | * |
||
555 | * @return string |
||
556 | */ |
||
557 | public function firmware(): ?string |
||
558 | { |
||
559 | return $this->firmware; |
||
560 | } |
||
561 | |||
562 | /** |
||
563 | * Set the firmware. |
||
564 | * |
||
565 | * @param string $firmware |
||
566 | * @return Device |
||
567 | */ |
||
568 | public function setFirmware(string $firmware) |
||
569 | { |
||
570 | $this->firmware = $firmware; |
||
571 | return $this; |
||
572 | } |
||
573 | |||
574 | /** |
||
575 | * Get the profiles. |
||
576 | * |
||
577 | * @return array |
||
578 | */ |
||
579 | public function profiles(): ?array |
||
580 | { |
||
581 | return $this->profiles; |
||
582 | } |
||
583 | |||
584 | /** |
||
585 | * Set the profiles. |
||
586 | * |
||
587 | * @param array|null $profiles |
||
588 | * @return Device |
||
589 | */ |
||
590 | public function setProfiles(?array $profiles) |
||
591 | { |
||
592 | $this->profiles = $profiles; |
||
0 ignored issues
–
show
It seems like
$profiles can be null . However, the property $profiles is declared as array . Maybe change the type of the property to array|null or add a type check?
Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array. Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property. To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter. function aContainsB(array $needle = null, array $haystack) {
if (!$needle) {
return false;
}
return array_intersect($haystack, $needle) == $haystack;
}
The function can be called with either null or an array for the parameter ![]() |
|||
593 | |||
594 | return $this; |
||
595 | } |
||
596 | } |
||
597 |