Total Complexity | 4 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | trait Translatable |
||
8 | { |
||
9 | protected $texts = []; |
||
10 | |||
11 | public function addText($text, $key = null) |
||
12 | { |
||
13 | if (array_key_exists($key, $this->texts)){ |
||
14 | return; |
||
15 | } |
||
16 | |||
17 | $this->texts[$key ?? $text] = $text; |
||
18 | } |
||
19 | |||
20 | public function translate() |
||
21 | { |
||
22 | LangManager::updateAll($this->texts); |
||
23 | } |
||
24 | |||
25 | public function getTexts() |
||
28 | } |
||
29 | } |
||
30 |