| Conditions | 4 |
| Paths | 3 |
| Total Lines | 28 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function handle(): void |
||
| 32 | { |
||
| 33 | $current = $this->porter->getDockerImageSet()->getName(); |
||
| 34 | |||
| 35 | if ($this->option('show')) { |
||
| 36 | $this->info('The current image set is: '.$current); |
||
| 37 | |||
| 38 | return; |
||
| 39 | } |
||
| 40 | |||
| 41 | $sets = app(ImageSetRepository::class) |
||
| 42 | ->availableImageSets() |
||
| 43 | ->mapWithKeys(function ($set) use ($current) { |
||
| 44 | return [$set => $set.($current == $set ? ' (current)' : '')]; |
||
| 45 | })->toArray(); |
||
| 46 | |||
| 47 | $option = $this->menu( |
||
| 48 | 'Available Image Sets', |
||
| 49 | $sets |
||
| 50 | )->open(); |
||
| 51 | |||
| 52 | if (!$option) { |
||
| 53 | return; |
||
| 54 | } |
||
| 55 | |||
| 56 | Setting::updateOrCreate('docker_image_set', $option); |
||
| 57 | |||
| 58 | Artisan::call('make-files'); |
||
| 59 | } |
||
| 61 |