| Total Complexity | 10 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | trait Ask |
||
| 12 | { |
||
| 13 | protected function getLocales(): array |
||
| 14 | { |
||
| 15 | if ($locales = $this->argument('locales')) { |
||
|
|
|||
| 16 | return $this->resolveSelectedLocales($locales); |
||
| 17 | } |
||
| 18 | |||
| 19 | return $this->askLocales($this->getMethod()); |
||
| 20 | } |
||
| 21 | |||
| 22 | protected function askLocales(string $method): array |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function getAllLocales(): array |
||
| 32 | } |
||
| 33 | |||
| 34 | protected function selectLocales(string $method) |
||
| 35 | { |
||
| 36 | return $this->choice("Select localizations to $method (specify the necessary localizations separated by commas):", $this->getAllLocales(), null, null, true); |
||
| 37 | } |
||
| 38 | |||
| 39 | protected function resolveSelectedLocales($locales): array |
||
| 44 | } |
||
| 45 | |||
| 46 | protected function getMethod(): string |
||
| 51 | } |
||
| 52 | |||
| 53 | protected function validatedLocales(array $locales): array |
||
| 62 |