Passed
Push — master ( 1b6475...610123 )
by Petr
10:18
created

TLang::getUppLang()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace kalanis\UploadPerPartes\Traits;
4
5
6
use kalanis\UploadPerPartes\Interfaces\IUPPTranslations;
7
use kalanis\UploadPerPartes\Uploader\Translations;
8
9
10
/**
11
 * Trait TEscape
12
 * @package kalanis\UploadPerPartes\Traits
13
 * Translations
14
 */
15
trait TLang
16
{
17
    /** @var IUPPTranslations|null */
18
    protected $uppLang = null;
19
20 50
    public function setUppLang(?IUPPTranslations $lang = null): self
21
    {
22 50
        $this->uppLang = $lang;
23 50
        return $this;
24
    }
25
26 34
    public function getUppLang(): IUPPTranslations
27
    {
28 34
        if (empty($this->uppLang)) {
29 7
            $this->uppLang = new Translations();
30
        }
31 34
        return $this->uppLang;
32
    }
33
}
34