Passed
Push — master ( d65c20...a7ba41 )
by Christian
02:11
created

MapperAbstract   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A mapFields() 0 3 1
1
<?php
2
namespace RemotelyLiving\PHPDNS\Mappers;
3
4
use RemotelyLiving\PHPDNS\Entities\DNSRecord;
5
use RemotelyLiving\PHPDNS\Entities\DNSRecordType;
6
7
abstract class MapperAbstract implements MapperInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $fields = [];
13
14
    public function __construct(array $fields = [])
15
    {
16
        $this->fields = $fields;
17
    }
18
19
    public function mapFields(array $fields): self
20
    {
21
        return new static($fields);
22
    }
23
24
    abstract public function toDNSRecord(): DNSRecord;
25
}
26