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