MapperAbstract   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mapFields() 0 3 1
A __construct() 0 2 1
1
<?php
2
3
namespace RemotelyLiving\PHPDNS\Mappers;
4
5
use RemotelyLiving\PHPDNS\Entities\Interfaces\DNSRecordInterface;
6
7
abstract class MapperAbstract implements MapperInterface
8
{
9
    final public function __construct(protected array $fields = [])
10
    {
11
    }
12
13
    public function mapFields(array $fields): MapperInterface
14
    {
15
        return new static($fields);
16
    }
17
18
    abstract public function toDNSRecord(): DNSRecordInterface;
19
}
20