Passed
Push — master ( 5d8af1...e44bd6 )
by Petr
09:24
created

Entity   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 37
ccs 8
cts 8
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 3 1
A __construct() 0 3 1
A getFormat() 0 3 1
A get() 0 3 1
A __clone() 0 2 1
1
<?php
2
3
namespace kalanis\kw_mapper\Storage\Storage\MultiContent;
4
5
6
use kalanis\kw_mapper\Interfaces\IFileFormat;
7
8
9
/**
10
 * Class Entity
11
 * @package kalanis\kw_mapper\Storage\Storage\MultiContent
12
 */
13
class Entity
14
{
15
    protected ?IFileFormat $formatClass = null;
16
    /** @var string[] */
17
    protected array $storage = [];
18
19 1
    public function __construct(IFileFormat $formatClass)
20
    {
21 1
        $this->formatClass = $formatClass;
22
    }
23
24
    /**
25
     * @codeCoverageIgnore why someone would run that?!
26
     */
27
    private function __clone()
28
    {
29
    }
30
31
    /**
32
     * @return string[]
33
     */
34 1
    public function get(): array
35
    {
36 1
        return $this->storage;
37
    }
38
39
    /**
40
     * @param string[] $content
41
     */
42 1
    public function set(array $content): void
43
    {
44 1
        $this->storage = $content;
45
    }
46
47 1
    public function getFormat(): ?IFileFormat
48
    {
49 1
        return $this->formatClass;
50
    }
51
}
52