Completed
Push — master ( a21f6f...b758b2 )
by Carlos
01:41
created

CnameResourceRecord::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Afonso\Dns;
6
7
/**
8
 * This class represents a DNS Resource Record of type CNAME.
9
 */
10
class CnameResourceRecord extends ResourceRecord
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $canonicalName;
16
17 9
    public function __construct(string $name, int $ttl, string $canonicalName)
18
    {
19 9
        parent::__construct($name, $ttl);
20 9
        $this->canonicalName = $canonicalName;
21 9
    }
22
23 3
    public function getType(): int
24
    {
25 3
        return ResourceRecord::TYPE_CNAME;
26
    }
27
28 6
    public function __toString(): string
29
    {
30 6
        return $this->canonicalName;
31
    }
32
}
33