Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function translate(): int |
||
23 | { |
||
24 | $count = 0; |
||
25 | foreach ($this->something as $something) { |
||
26 | $texts = $something[0]->load(); |
||
27 | $newTexts = $something[2]->translate(array_values($texts)); |
||
28 | |||
29 | $translations = []; |
||
30 | foreach ($texts as $key => $text) { |
||
31 | $translations[$key] = $newTexts[$text] ?? ''; |
||
32 | $count++; |
||
33 | } |
||
34 | $something[1]->save($translations); |
||
35 | } |
||
36 | return $count; |
||
37 | } |
||
39 |