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

TLang   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setLang() 0 3 1
A getLang() 0 6 2
1
<?php
2
3
namespace kalanis\kw_files\Traits;
4
5
6
use kalanis\kw_files\Interfaces\IFLTranslations;
7
use kalanis\kw_files\Translations;
8
9
10
/**
11
 * Trait TLang
12
 * @package kalanis\kw_files\Processing
13
 * Translations trait
14
 */
15
trait TLang
16
{
17
    /** @var IFLTranslations|null */
18
    protected $lang = null;
19
20 83
    public function setLang(?IFLTranslations $lang = null): void
21
    {
22 83
        $this->lang = $lang;
23 83
    }
24
25 44
    public function getLang(): IFLTranslations
26
    {
27 44
        if (empty($this->lang)) {
28 44
            $this->lang = new Translations();
29
        }
30 44
        return $this->lang;
31
    }
32
}
33