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

TFile::setPath()   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 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
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\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