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

AbstractCallableDataStructure::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
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
abstract class AbstractCallableDataStructure implements DataStructure {
8
9
    /**
10
     * @var callable
11
     */
12
    private $mappingFunction;
13
14
    /**
15
     * @var array
16
     */
17
    private $data;
18
19 4
    public function __construct(callable $mappingFunction, ...$data) {
20 4
        $this->mappingFunction = $mappingFunction;
21 4
        $this->data            = $data;
22 4
    }
23
24 4
    public function getMappingFunction(): callable {
25 4
        return $this->mappingFunction;
26
    }
27
28 4
    public function getData(): array {
29 4
        return $this->data;
30
    }
31
}
32