Passed
Push — master ( bf075b...6deca2 )
by Petr
07:21
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
c 1
b 0
f 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
wmc 3

2 Methods

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