Passed
Push — master ( b1a1ed...6d9281 )
by Darko
11:24
created

FileCompletionStatus::description()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Enums;
6
7
/**
8
 * Binary file completion status during collection processing.
9
 */
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
33
    {
34
        return $this === self::Complete;
35
    }
36
}
37
38