AResourceRecord   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A getType() 0 3 1
A __construct() 0 4 1
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 A.
9
 */
10
class AResourceRecord extends ResourceRecord
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $address;
16
17 9
    public function __construct(string $name, int $ttl, string $address)
18
    {
19 9
        parent::__construct($name, $ttl);
20 9
        $this->address = $address;
21 9
    }
22
23 3
    public function getType(): int
24
    {
25 3
        return ResourceRecord::TYPE_A;
26
    }
27
28 6
    public function __toString(): string
29
    {
30 6
        return $this->address;
31
    }
32
}
33