Download src/app/Enums/StatusEnum.php from pnacorp/xsender: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Enums/StatusEnum.php
- Command line
-
hf download hf://pnacorp/xsender/src/app/Enums/StatusEnum.php
-
curl -L -o StatusEnum.php https://huggingface.co/pnacorp/xsender/resolve/main/src/app/Enums/StatusEnum.php
689 Bytes
| namespace App\Enums; | |
| enum StatusEnum { | |
| case TRUE; | |
| case FALSE; | |
| /** | |
| * get enum status | |
| */ | |
| public function status(): string | |
| { | |
| return match($this) | |
| { | |
| StatusEnum::TRUE => '1', | |
| StatusEnum::FALSE => '0', | |
| }; | |
| } | |
| public static function toArray() :array{ | |
| return [ | |
| 'Active' => (StatusEnum::TRUE)->status(), | |
| 'Inactive' => (StatusEnum::FALSE)->status() | |
| ]; | |
| } | |
| public static function getBoolean(int $value) { | |
| return match ($value) { | |
| self::TRUE => true, | |
| self::FALSE => false, | |
| }; | |
| } | |
| } |