Completed
Push — master ( 1d13ba...f9bf31 )
by Sam
49:13
created

MX::getPreference()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of Badcow DNS Library.
5
 *
6
 * (c) Samuel Williams <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Badcow\DNS\Rdata;
13
14
use Badcow\DNS\Validator;
15
16
class MX implements RdataInterface
17
{
18
    use RdataTrait;
19
20
    const TYPE = 'MX';
21
22
    /**
23
     * @var int
24
     */
25
    private $preference;
26
27
    /**
28
     * @var string
29
     */
30
    private $exchange;
31
32
    /**
33
     * @param string $exchange
34
     */
35
    public function setExchange($exchange)
36
    {
37
        $this->exchange = $exchange;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getExchange()
44
    {
45
        return $this->exchange;
46
    }
47
48
    /**
49
     * @param int $preference
50
     */
51
    public function setPreference($preference)
52
    {
53
        $this->preference = (int) $preference;
54
    }
55
56
    /**
57
     * @return int
58
     */
59
    public function getPreference()
60
    {
61
        return $this->preference;
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function output()
68
    {
69
        return $this->preference . ' ' . $this->exchange;
70
    }
71
}
72