| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | class Remove extends BaseProcessor |
||
| 27 | { |
||
| 28 | protected $paths = []; |
||
| 29 | |||
| 30 | public function handle(Provider $provider): void |
||
| 31 | { |
||
| 32 | foreach ($this->locales as $locale) { |
||
| 33 | $json = $this->resourcesPath($locale . '.json'); |
||
| 34 | $php = $this->resourcesPath($locale); |
||
| 35 | |||
| 36 | $this->push($json, $php); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | public function finish(): void |
||
| 41 | { |
||
| 42 | Filesystem::delete($this->paths); |
||
| 43 | } |
||
| 44 | |||
| 45 | protected function prepareLocales(array $locales): array |
||
| 46 | { |
||
| 47 | $except = Locales::protects(); |
||
| 48 | |||
| 49 | return array_diff($locales, $except); |
||
| 50 | } |
||
| 51 | |||
| 52 | protected function push(string ...$paths): void |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
||
| 59 |