TStream::setProcessStream()   A
last analyzed

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 0
Metric Value
cc 1
eloc 1
c 1
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_files\Traits;
4
5
6
use kalanis\kw_files\FilesException;
7
use kalanis\kw_files\Interfaces\IProcessFileStreams;
8
9
10
/**
11
 * Trait TStream
12
 * @package kalanis\kw_files\Traits
13
 */
14
trait TStream
15
{
16
    use TLang;
17
18
    protected ?IProcessFileStreams $processStream = null;
19
20 1
    public function setProcessStream(?IProcessFileStreams $dirs = null): void
21
    {
22 1
        $this->processStream = $dirs;
23
    }
24
25
    /**
26
     * @throws FilesException
27
     * @return IProcessFileStreams
28
     */
29 2
    public function getProcessStream(): IProcessFileStreams
30
    {
31 2
        if (empty($this->processStream)) {
32 1
            throw new FilesException($this->getFlLang()->flNoProcessStreamSet());
33
        }
34 1
        return $this->processStream;
35
    }
36
}
37