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

TLang   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUppLang() 0 4 1
A getUppLang() 0 6 2
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