Passed
Push — master ( c85748...2fd0ab )
by Petr
08:11
created

TFile   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPath() 0 3 1
A getFileAccessor() 0 3 1
A setFileAccessor() 0 3 1
A setPath() 0 3 1
1
<?php
2
3
namespace kalanis\kw_mapper\Storage\File;
4
5
6
use kalanis\kw_files\Interfaces\IProcessFiles;
7
use kalanis\kw_mapper\MapperException;
8
9
10
/**
11
 * Trait TFile
12
 * @package kalanis\kw_mapper\Storage\File
13
 */
14
trait TFile
15
{
16
    /** @var string[] */
17
    protected $presetPath = [];
18
19 7
    protected function setFileAccessor(?IProcessFiles $file): void
20
    {
21 7
        FilesSingleton::getInstance()->setFileAccessor($file);
22
    }
23
24
    /**
25
     * @throws MapperException
26
     * @return IProcessFiles
27
     */
28 7
    protected function getFileAccessor(): IProcessFiles
29
    {
30 7
        return FilesSingleton::getInstance()->getFilesAccessor();
31
    }
32
33
    /**
34
     * @param string[] $path
35
     */
36 2
    protected function setPath(array $path): void
37
    {
38 2
        $this->presetPath = $path;
39
    }
40
41
    /**
42
     * @return string[]
43
     */
44 6
    protected function getPath(): array
45
    {
46 6
        return $this->presetPath;
47
    }
48
}
49