Total Complexity | 4 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 57.14% |
Changes | 0 |
1 | <?php |
||
11 | class NetworkAddressTimestamp extends NetworkAddress |
||
12 | { |
||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | private $time; |
||
17 | |||
18 | /** |
||
19 | * @param int $time |
||
20 | * @param int $services |
||
21 | * @param IpInterface $ip |
||
22 | 14 | * @param int $port |
|
23 | */ |
||
24 | 14 | public function __construct( |
|
25 | 14 | int $time, |
|
26 | 14 | int $services, |
|
27 | IpInterface $ip, |
||
28 | int $port |
||
29 | ) { |
||
30 | $this->time = $time; |
||
31 | 6 | parent::__construct($services, $ip, $port); |
|
32 | } |
||
33 | 6 | ||
34 | /** |
||
35 | * @return int |
||
36 | */ |
||
37 | public function getTimestamp(): int |
||
38 | { |
||
39 | return $this->time; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return NetworkAddress |
||
44 | */ |
||
45 | public function withoutTimestamp(): NetworkAddress |
||
46 | { |
||
47 | return new NetworkAddress( |
||
48 | $this->getServices(), |
||
49 | $this->getIp(), |
||
50 | $this->getPort() |
||
51 | 3 | ); |
|
52 | } |
||
53 | 3 | ||
54 | /** |
||
55 | * @return BufferInterface |
||
56 | */ |
||
57 | public function getBuffer(): BufferInterface |
||
60 | } |
||
61 | } |
||
62 |