1 | <?php |
||
9 | class NetworkAddressTimestamp extends NetworkAddress |
||
10 | { |
||
11 | /** |
||
12 | * @var int|string |
||
13 | */ |
||
14 | private $time; |
||
15 | |||
16 | /** |
||
17 | * @param int $time |
||
18 | * @param int $services |
||
19 | * @param IpInterface $ip |
||
20 | * @param int|string $port |
||
21 | */ |
||
22 | 12 | public function __construct($time, $services, IpInterface $ip, $port) |
|
23 | { |
||
24 | 12 | $this->time = $time; |
|
25 | 12 | parent::__construct($services, $ip, $port); |
|
26 | 12 | } |
|
27 | |||
28 | /** |
||
29 | * @return int|string |
||
30 | */ |
||
31 | 6 | public function getTimestamp() |
|
35 | |||
36 | /** |
||
37 | * @return NetworkAddress |
||
38 | */ |
||
39 | 3 | public function withoutTimestamp() |
|
40 | { |
||
41 | 3 | return new NetworkAddress( |
|
42 | 3 | $this->getServices(), |
|
43 | 3 | $this->getIp(), |
|
44 | 3 | $this->getPort() |
|
45 | 1 | ); |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return BufferInterface |
||
50 | */ |
||
51 | 3 | public function getBuffer() |
|
55 | } |
||
56 |