Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
25 | public function translate() |
||
26 | { |
||
27 | foreach ($this->tokenizers as $tokenizer) { |
||
28 | foreach ($tokenizer->tokenize() as $tokenCollection) { |
||
29 | // tento kod by som mohol dat do nejakeho file updatera |
||
30 | $content = file_get_contents($tokenCollection->getFilePath()); |
||
31 | $newTexts = []; |
||
32 | foreach ($tokenCollection->getTokens() as $token) { |
||
33 | $newTexts[$token->getOriginalBlock()] = str_replace($token->getOriginalText(), $token->getTranslationCode(), $token->getOriginalBlock()); |
||
34 | } |
||
35 | $content = str_replace(array_keys($newTexts), array_values($newTexts), $content); |
||
36 | file_put_contents($tokenCollection->getFilePath(), $content); |
||
37 | |||
38 | $this->saver->save($tokenCollection); |
||
39 | } |
||
43 |