Passed
Push — master ( 66e2c6...742734 )
by Sam
03:55
created

PolymorphicRdata::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Badcow\DNS\Parser;
4
5
use Badcow\DNS\Rdata\RdataInterface;
6
7
class PolymorphicRdata implements RdataInterface
8
{
9
    /**
10
     * The RData type.
11
     *
12
     * @var string
13
     */
14
    private $type;
15
16
    /**
17
     * @var string
18
     */
19
    private $data;
20
21
    /**
22
     * PolymorphicRdata constructor.
23
     *
24
     * @param string|null $type
25
     * @param string|null $data
26
     */
27 1
    public function __construct(string $type = null, string $data = null)
28
    {
29 1
        $this->type = $type;
30 1
        $this->data = $data;
31 1
    }
32
33
    /**
34
     * @param string $type
35
     */
36
    public function setType(string $type): void
37
    {
38
        $this->type = $type;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 1
    public function getType(): string
45
    {
46 1
        return $this->type;
47
    }
48
49
    /**
50
     * @param string $data
51
     */
52
    public function setData(string $data): void
53
    {
54
        $this->data = $data;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getData(): string
61
    {
62
        return $this->data;
63
    }
64
65
    /**
66
     * @return string
67
     */
68 1
    public function output(): string
69
    {
70 1
        return $this->data;
71
    }
72
}
73