| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function handle(): void |
||
| 16 | { |
||
| 17 | $lang = $this->argument('lang'); |
||
| 18 | |||
| 19 | if (!file_exists('resources/lang/' . $lang . '.json')) { |
||
|
|
|||
| 20 | $this->error($lang . '.json doesn\'t exist'); |
||
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | $jsonFile = file_get_contents('resources/lang/' . $lang . '.json'); |
||
| 25 | |||
| 26 | $count = collect(json_decode($jsonFile, true)) |
||
| 27 | ->filter( |
||
| 28 | function ($value, $key) { |
||
| 29 | return $key === $value; |
||
| 30 | } |
||
| 31 | )->each( |
||
| 32 | function ($value) { |
||
| 33 | $this->line($value); |
||
| 34 | } |
||
| 35 | )->count(); |
||
| 36 | |||
| 37 | $this->info('Untranslated lines: ' . $count); |
||
| 38 | } |
||
| 39 | } |