Request   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
c 1
b 0
f 1
dl 0
loc 24
ccs 10
cts 10
cp 1
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getName() 0 3 1
A getType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Afonso\Dns;
6
7
class Request
8
{
9
    protected $name;
10
11
    protected $type;
12
13 12
    public function __construct(string $name, int $type)
14
    {
15 12
        if (!ResourceRecord::isValidType($type)) {
16 3
            throw new \InvalidArgumentException("'${type}' is not a valid DNS resource record type");
17
        }
18
19 9
        $this->name = $name;
20 9
        $this->type = $type;
21 9
    }
22
23 9
    public function getName(): string
24
    {
25 9
        return $this->name;
26
    }
27
28 6
    public function getType(): int
29
    {
30 6
        return $this->type;
31
    }
32
}
33