Associative   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 41
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getData() 0 3 1
A setData() 0 8 1
A prepareDataKernel() 0 3 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
}