Issues (2)

php-src/Traits/TLang.php (1 issue)

1
<?php
2
3
namespace kalanis\kw_bans\Traits;
4
5
6
use kalanis\kw_bans\Interfaces\IKBTranslations;
7
use kalanis\kw_bans\Translations;
8
9
10
trait TLang
11
{
12
    protected ?IKBTranslations $iKbLang = null;
13
14 29
    protected function setIKbLang(?IKBTranslations $iKbLang = null): void
15
    {
16 29
        $this->iKbLang = $iKbLang;
17 29
    }
18
19 17
    protected function getIKbLang(): IKBTranslations
20
    {
21 17
        if (empty($this->iKbLang)) {
22 16
            $this->iKbLang = new Translations();
23
        }
24 17
        return $this->iKbLang;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->iKbLang could return the type null which is incompatible with the type-hinted return kalanis\kw_bans\Interfaces\IKBTranslations. Consider adding an additional type-check to rule them out.
Loading history...
25
    }
26
}
27