Passed
Push — master ( 6139d1...678a4c )
by Petr
13:22 queued 10:27
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
    /** @var IFileFormat|null */
16
    protected $formatClass = null;
17
    /** @var string[] */
18
    protected $storage = [];
19
20 1
    public function __construct(IFileFormat $formatClass)
21
    {
22 1
        $this->formatClass = $formatClass;
23 1
    }
24
25
    /**
26
     * @codeCoverageIgnore why someone would run that?!
27
     */
28
    private function __clone()
29
    {
30
    }
31
32
    /**
33
     * @return string[]
34
     */
35 1
    public function get(): array
36
    {
37 1
        return $this->storage;
38
    }
39
40
    /**
41
     * @param string[] $content
42
     */
43 1
    public function set(array $content): void
44
    {
45 1
        $this->storage = $content;
46 1
    }
47
48 1
    public function getFormat(): ?IFileFormat
49
    {
50 1
        return $this->formatClass;
51
    }
52
}
53