true, self::Pending, self::Infected, self::UnscannableBlocked => false, }; } /** * The states a query may hand to somebody other than staff. * * @return list */ public static function availableValues(): array { return array_values(array_map( fn (self $status): string => $status->value, array_filter(self::cases(), fn (self $status): bool => $status->isAvailable()), )); } /** Whether this state is waiting on an administrator's decision. */ public function isQuarantined(): bool { return $this === self::Infected || $this === self::UnscannableBlocked; } /** * English, and the translation key — what staff see on the file. */ public function label(): string { return match ($this) { self::Pending => 'Checking for viruses', self::Clean => 'Checked', self::Infected => 'Quarantined', self::Released => 'Released by an administrator', self::NotScanned => 'Not scanned', self::UnscannableBlocked => 'Blocked: could not be scanned', }; } }