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