| Total Complexity | 7 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class Missing |
||
| 13 | { |
||
| 14 | use Makeable; |
||
| 15 | use Pathable; |
||
| 16 | |||
| 17 | protected $locale = LocalesList::ENGLISH; |
||
| 18 | |||
| 19 | public function missing(string $package): array |
||
| 20 | { |
||
| 21 | return array_diff($this->packageable($package), $this->available()); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function unnecessary(string $package): array |
||
| 25 | { |
||
| 26 | return array_diff($this->available(), $this->packageable($package)); |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function available(): array |
||
| 30 | { |
||
| 31 | return Locales::available(true); |
||
| 32 | } |
||
| 33 | |||
| 34 | protected function packageable(string $package): array |
||
| 44 | } |
||
| 45 | |||
| 46 | protected function defaultLocale(): string |
||
| 47 | { |
||
| 48 | return LocalesList::ENGLISH; |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function locales(string $package): array |
||
| 52 | { |
||
| 53 | $path = $this->path($package); |
||
| 54 | |||
| 55 | return Directory::names($path); |
||
| 56 | } |
||
| 57 | |||
| 58 | protected function path(string $package): string |
||
| 61 | } |
||
| 62 | } |
||
| 63 |