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

MX   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 56
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setExchange() 0 4 1
A getExchange() 0 4 1
A setPreference() 0 4 1
A getPreference() 0 4 1
A output() 0 4 1
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