Associative::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Mapper\Kind;
6
7
use Mapper\Kind;
8
9
/**
10
 * Class Associative
11
 * @package Mapper\Kind
12
 */
13
class Associative extends Kind {
14
15
    /**
16
     * Associative constructor.
17
     * @param array $data
18
     * @param object $object
19
     */
20 1
    public function __construct(array $data, $object) {
21 1
        $this->data = $data;
22
23 1
        parent::__construct($object);
24 1
    }
25
26
    /**
27
     * @return array
28
     */
29 1
    public function getData(): array {
30 1
        return $this->data;
31
    }
32
33
    /**
34
     * @param array $data
35
     * @return Associative
36
     */
37 1
    public function setData(array $data): Associative {
38 1
        $this->data = $data;
39
40 1
        $this->getKernel()
41 1
            ->setData($data);
42
43 1
        return $this;
44
    }
45
46
    /**
47
     * @return array
48
     */
49 1
    protected function prepareDataKernel(): array {
50 1
        return $this->getData();
51
    }
52
53
}