Total Complexity | 7 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 73.32% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Missing extends Command |
||
9 | { |
||
10 | protected $signature = 'lang:missing'; |
||
11 | |||
12 | protected $description = 'Helps identify missing localizations for publication.'; |
||
13 | |||
14 | protected $hidden = true; |
||
15 | |||
16 | 1 | public function handle(MissingSupport $missing) |
|
17 | { |
||
18 | 1 | if ($this->missingError($missing) || $this->unnecessaryError($missing)) { |
|
19 | return; |
||
20 | } |
||
21 | |||
22 | 1 | $this->info('Congratulations! All localizations are available!'); |
|
23 | 1 | } |
|
24 | |||
25 | 1 | protected function missingError(MissingSupport $missing): bool |
|
28 | } |
||
29 | |||
30 | 1 | protected function unnecessaryError(MissingSupport $missing): bool |
|
31 | { |
||
32 | 1 | return $this->isError($missing->unnecessary(), 'We found the following unnecessary localizations:'); |
|
33 | } |
||
34 | |||
35 | 1 | protected function isError(array $locales, string $message): bool |
|
45 | } |
||
46 | } |
||
47 |