TDir   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 1
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setProcessDir() 0 3 1
A getProcessDir() 0 6 2
1
<?php
2
3
namespace kalanis\kw_files\Traits;
4
5
6
use kalanis\kw_files\FilesException;
7
use kalanis\kw_files\Interfaces\IProcessDirs;
8
9
10
/**
11
 * trait TDir
12
 * @package kalanis\kw_files\Traits
13
 */
14
trait TDir
15
{
16
    use TLang;
17
18
    protected ?IProcessDirs $processDir = null;
19
20 1
    public function setProcessDir(?IProcessDirs $dirs = null): void
21
    {
22 1
        $this->processDir = $dirs;
23
    }
24
25
    /**
26
     * @throws FilesException
27
     * @return IProcessDirs
28
     */
29 2
    public function getProcessDir(): IProcessDirs
30
    {
31 2
        if (empty($this->processDir)) {
32 1
            throw new FilesException($this->getFlLang()->flNoProcessDirSet());
33
        }
34 1
        return $this->processDir;
35
    }
36
}
37