Total Complexity | 6 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
16 | class PolymorphicRdata implements RdataInterface |
||
17 | { |
||
18 | /** |
||
19 | * The RData type. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $type; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $data; |
||
29 | |||
30 | /** |
||
31 | * PolymorphicRdata constructor. |
||
32 | * |
||
33 | * @param string|null $type |
||
34 | * @param string|null $data |
||
35 | */ |
||
36 | 1 | public function __construct(string $type = null, string $data = null) |
|
37 | { |
||
38 | 1 | $this->setType($type); |
|
39 | 1 | $this->setData($data); |
|
40 | 1 | } |
|
41 | |||
42 | /** |
||
43 | * @param string $type |
||
44 | */ |
||
45 | 1 | public function setType(?string $type): void |
|
46 | { |
||
47 | 1 | $this->type = $type; |
|
48 | 1 | } |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getType(): string |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param string $data |
||
60 | */ |
||
61 | 1 | public function setData(?string $data): void |
|
64 | 1 | } |
|
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | 1 | public function getData(): string |
|
72 | } |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | 1 | public function output(): string |
|
82 |