Total Complexity | 6 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class Remove extends BaseProcessor |
||
13 | { |
||
14 | protected $paths = []; |
||
15 | |||
16 | public function handle(Provider $provider): void |
||
17 | { |
||
18 | foreach ($this->locales as $locale) { |
||
19 | $json = $this->resourcesPath($locale . '.json'); |
||
20 | $php = $this->resourcesPath($locale); |
||
21 | |||
22 | $this->push($json, $php); |
||
23 | } |
||
24 | } |
||
25 | |||
26 | public function finish(): void |
||
27 | { |
||
28 | Filesystem::delete($this->paths); |
||
29 | } |
||
30 | |||
31 | protected function prepareLocales(array $locales): array |
||
32 | { |
||
33 | $except = Locales::protects(); |
||
34 | |||
35 | return Arr::except($locales, $except); |
||
36 | } |
||
37 | |||
38 | protected function push(string ...$paths): void |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 |