Do it your self without of magic ! ;-) We have PHP 8.1 now.
enum DataType: string {
case ACCEPTED = "accepted";
case WITH_ERRORS = "with errore";
case DONE = "done";
case FAILED ='failed';
public function toString(): string {
return match($this){
self::ACCEPTED => 'Accepted',
self::WITH_ERRORS => 'With Errors',
self::DONE => 'Done',
self::FAILED => 'Failed',
default => '',
};
}
}
echo DataType::DONE->toString();