Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
9 | final class Service |
||
10 | { |
||
11 | private $typeId; |
||
12 | private $port; |
||
13 | |||
14 | /** |
||
15 | * @param int $typeId |
||
16 | * @param int $port |
||
17 | * @throws InvalidValueException |
||
18 | */ |
||
19 | 13 | public function __construct(int $typeId, int $port) |
|
20 | { |
||
21 | 13 | $this->typeId = validate_uint8('Service type ID', $typeId); |
|
22 | 11 | $this->port = validate_uint32('Port', $port); |
|
23 | } |
||
24 | |||
25 | 3 | public function getTypeId(): int |
|
28 | } |
||
29 | |||
30 | 3 | public function getPort(): int |
|
31 | { |
||
32 | 3 | return $this->port; |
|
33 | } |
||
34 | |||
35 | 2 | public function getName(): string |
|
41 | } |
||
42 | } |
||
43 | } |
||
44 |