Passed
Push — master ( 0000af...b571e7 )
by Petr
07:35
created

TLang::setSmLang()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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