| Total Complexity | 9 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class SRVData extends DataAbstract |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var int |
||
| 9 | */ |
||
| 10 | private $priority; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | private $weight; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | private $port; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var \RemotelyLiving\PHPDNS\Entities\Hostname |
||
| 24 | */ |
||
| 25 | private $target; |
||
| 26 | |||
| 27 | public function __construct(int $priority, int $weight, int $port, Hostname $target) |
||
| 28 | { |
||
| 29 | $this->priority = $priority; |
||
| 30 | $this->weight = $weight; |
||
| 31 | $this->port = $port; |
||
| 32 | $this->target = $target; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function __toString(): string |
||
| 36 | { |
||
| 37 | return "{$this->priority} {$this->weight} {$this->port} {$this->target}"; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getPriority(): int |
||
| 41 | { |
||
| 42 | return $this->priority; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getWeight(): int |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getPort(): int |
||
| 51 | { |
||
| 52 | return $this->port; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getTarget(): Hostname |
||
| 58 | } |
||
| 59 | |||
| 60 | public function toArray(): array |
||
| 61 | { |
||
| 67 | ]; |
||
| 68 | } |
||
| 69 | |||
| 70 | public function serialize(): string |
||
| 71 | { |
||
| 72 | return \serialize($this->toArray()); |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @param string $serialized |
||
| 77 | */ |
||
| 78 | public function unserialize($serialized): void |
||
| 85 | } |
||
| 86 | } |
||
| 87 |