| Total Complexity | 9 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 4 | class SRVData extends DataAbstract |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * @var string |
||
| 8 | */ |
||
| 9 | private $value; |
||
| 10 | private $weight; |
||
| 11 | private $target; |
||
| 12 | private $priority; |
||
| 13 | private $port; |
||
| 14 | |||
| 15 | public function __construct(int $priority, int $weight, int $port, Hostname $target, string $value) |
||
| 16 | { |
||
| 17 | $this->priority = $priority; |
||
| 18 | $this->target = $target; |
||
| 19 | $this->value = $value; |
||
| 20 | $this->weight = $weight; |
||
| 21 | $this->port = $port; |
||
| 22 | |||
| 23 | } |
||
| 24 | |||
| 25 | public function __toString(): string |
||
| 26 | { |
||
| 27 | return "{$this->priority} {$this->weight} {$this->port} {$this->target}"; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getPriority(): string |
||
| 31 | { |
||
| 32 | return $this->priority; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getTarget(): string |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getValue(): string |
||
| 41 | { |
||
| 42 | return $this->value; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getWeight(): string |
||
| 46 | { |
||
| 47 | return $this->weight; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function toArray(): array |
||
| 58 | ]; |
||
| 59 | } |
||
| 60 | |||
| 61 | public function serialize(): string |
||
| 62 | { |
||
| 63 | return \serialize($this->toArray()); |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param string $serialized |
||
| 68 | */ |
||
| 69 | public function unserialize($serialized): void |
||
| 77 | |||
| 78 | } |
||
| 79 | } |
||
| 80 |