Passed
Push — master ( cdd133...439166 )
by Martin
03:26
created

AbstractDataStructure::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace KingsonDe\Marshal\Data;
6
7
use KingsonDe\Marshal\AbstractMapper;
8
9
abstract class AbstractDataStructure implements DataStructure {
10
11
    /**
12
     * @var AbstractMapper
13
     */
14
    private $mapper;
15
16
    /**
17
     * @var mixed[]
18
     */
19
    private $data;
20
21
    /**
22
     * @param AbstractMapper $mapper
23
     * @param array $data
24
     */
25 6
    public function __construct(AbstractMapper $mapper, ...$data) {
26 6
        $this->mapper = $mapper;
27 6
        $this->data   = $data;
28 6
    }
29
30 6
    protected function getMapper(): AbstractMapper {
31 6
        return $this->mapper;
32
    }
33
34 6
    protected function getData(): array {
35 6
        return $this->data;
36
    }
37
}
38