| Conditions | 4 |
| Paths | 10 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function handle(): int |
||
| 24 | { |
||
| 25 | $type = $this->option('type') ?? ''; |
||
| 26 | $time = $this->option('time') ?? 'full'; |
||
| 27 | $blacklistId = $this->option('blacklist-id') ?? ''; |
||
| 28 | $delete = $this->option('delete'); |
||
| 29 | |||
| 30 | if (! $delete) { |
||
| 31 | $this->warn('Running in DRY-RUN mode. Use --delete to actually remove releases.'); |
||
| 32 | } |
||
| 33 | |||
| 34 | try { |
||
| 35 | $remover = new ReleaseRemover; |
||
| 36 | $result = $remover->removeCrap($delete, $time, $type, $blacklistId); |
||
|
|
|||
| 37 | |||
| 38 | if ($result === true) { |
||
| 39 | return self::SUCCESS; |
||
| 40 | } |
||
| 41 | |||
| 42 | $this->error($result); |
||
| 43 | |||
| 44 | return self::FAILURE; |
||
| 45 | } catch (\Exception $e) { |
||
| 46 | $this->error($e->getMessage()); |
||
| 47 | |||
| 48 | return self::FAILURE; |
||
| 49 | } |
||
| 52 |