Passed
Push — master ( cb2d88...e8a992 )
by Petr
08:25
created

TNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setProcessNode() 0 3 1
A getProcessNode() 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\IProcessNodes;
8
9
10
/**
11
 * Trait TNode
12
 * @package kalanis\kw_files\Processing
13
 */
14
trait TNode
15
{
16
    use TLang;
17
18
    /** @var IProcessNodes|null */
19
    protected $processNode = null;
20
21 1
    public function setProcessNode(?IProcessNodes $dirs = null): void
22
    {
23 1
        $this->processNode = $dirs;
24 1
    }
25
26
    /**
27
     * @throws FilesException
28
     * @return IProcessNodes
29
     */
30 2
    public function getProcessNode(): IProcessNodes
31
    {
32 2
        if (empty($this->processNode)) {
33 1
            throw new FilesException($this->getLang()->flNoProcessNodeSet());
34
        }
35 1
        return $this->processNode;
36
    }
37
}
38