| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function handle() |
||
| 44 | { |
||
| 45 | $targetLanguages = Arr::wrap(config('auto-translate.target_language')); |
||
| 46 | |||
| 47 | $this->line('Found '.count($targetLanguages).' languages to translate'); |
||
| 48 | |||
| 49 | $bar = $this->output->createProgressBar(count($targetLanguages)); |
||
| 50 | $bar->start(); |
||
| 51 | |||
| 52 | $missingCount = 0; |
||
| 53 | |||
| 54 | foreach ($targetLanguages as $targetLanguage) { |
||
| 55 | $missing = $this->autoTranslator->getMissingTranslations($targetLanguage); |
||
| 56 | $missingCount += $missing->count(); |
||
| 57 | |||
| 58 | $translated = $this->autoTranslator->translate($targetLanguage, $missing); |
||
| 59 | |||
| 60 | $this->autoTranslator->fillLanguageFiles($targetLanguage, $translated); |
||
| 61 | |||
| 62 | $bar->advance(); |
||
| 63 | } |
||
| 64 | |||
| 65 | $bar->finish(); |
||
| 66 | |||
| 67 | $this->info('Translated '.$missingCount.' missing language keys.'); |
||
| 68 | } |
||
| 69 | } |
||
| 70 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.