-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathServerPublicNetIPv6.php
More file actions
49 lines (44 loc) · 970 Bytes
/
ServerPublicNetIPv6.php
File metadata and controls
49 lines (44 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace LKDev\HetznerCloud\Models\Servers;
/**
* Class ServerPublicNetIPv6.
*/
class ServerPublicNetIPv6
{
/**
* @var string
*/
public $ip;
/**
* @var bool
*/
public $blocked;
/**
* @var array
*/
public $dnsPtr;
/**
* ServerPublicNetIPv6 constructor.
* @param string $ip
* @param bool $blocked
* @param array $dnsPtr
*/
public function __construct(string $ip, bool $blocked, array $dnsPtr)
{
$this->ip = $ip;
$this->blocked = $blocked;
$this->dnsPtr = $dnsPtr;
}
/**
* @param \stdClass $data
* @return ServerPublicNetIPv6
*/
public static function parse(\stdClass $data)
{
$dnsPtrs = [];
foreach ($data->dns_ptr as $dnsPtr) {
$dnsPtrs[] = new ServerPublicNetIPv6DnsPtr($dnsPtr->ip, $dnsPtr->dns_ptr);
}
return new self($data->ip, $data->blocked, $dnsPtrs);
}
}