| Total Complexity | 2 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | enum FileCompletionStatus: int |
||
| 11 | { |
||
| 12 | /** File/binary is still incomplete (missing parts) */ |
||
| 13 | case Incomplete = 0; |
||
| 14 | |||
| 15 | /** File/binary has all parts */ |
||
| 16 | case Complete = 1; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Get human-readable description. |
||
| 20 | */ |
||
| 21 | public function description(): string |
||
| 22 | { |
||
| 23 | return match ($this) { |
||
| 24 | self::Incomplete => 'Incomplete', |
||
| 25 | self::Complete => 'Complete', |
||
| 26 | }; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Check if file is complete. |
||
| 31 | */ |
||
| 32 | public function isComplete(): bool |
||
| 35 | } |
||
| 36 | } |
||
| 38 |