RdataTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 5 1
A getTypeCode() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Badcow DNS Library.
7
 *
8
 * (c) Samuel Williams <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Badcow\DNS\Rdata;
15
16
trait RdataTrait
17
{
18
    /**
19
     * Get the string representation of the Rdata type.
20
     *
21
     * @return string Rdata type, e.g. "A", "MX", "NS", etc.
22
     */
23 47
    public function getType(): string
24
    {
25
        /* @const TYPE */
26 47
        return static::TYPE;
27
    }
28
29
    /**
30
     * Get the integer type code of the Rdata type as defined by IANA.
31
     *
32
     * @return int IANA Rdata type code
33
     */
34 17
    public function getTypeCode(): int
35
    {
36
        /* @const TYPE_CODE */
37 17
        return static::TYPE_CODE;
38
    }
39
}
40