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

Entity::set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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