mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Convert MessageStatus to a class
Appwrite is using PHP 8 which doesn't support backed enums.
This commit is contained in:
parent
af019369e9
commit
34af90b65e
1 changed files with 31 additions and 6 deletions
|
|
@ -2,26 +2,51 @@
|
||||||
|
|
||||||
namespace Appwrite\Enum;
|
namespace Appwrite\Enum;
|
||||||
|
|
||||||
enum MessageStatus: string
|
// TODO: Convert to backed enum after upgrading to PHP 8.1
|
||||||
|
// enum MessageStatus: string
|
||||||
|
// {
|
||||||
|
// /**
|
||||||
|
// * Message that is not ready to be sent
|
||||||
|
// */
|
||||||
|
// case Draft = 'draft';
|
||||||
|
// /**
|
||||||
|
// * Scheduled to be sent for a later time
|
||||||
|
// */
|
||||||
|
// case Scheduled = 'scheduled';
|
||||||
|
// /**
|
||||||
|
// * Picked up by the worker and starting to send
|
||||||
|
// */
|
||||||
|
// case Processing = 'processing';
|
||||||
|
// /**
|
||||||
|
// * Sent without errors
|
||||||
|
// */
|
||||||
|
// case Sent = 'sent';
|
||||||
|
// /**
|
||||||
|
// * Sent with some errors
|
||||||
|
// */
|
||||||
|
// case Failed = 'failed';
|
||||||
|
// }
|
||||||
|
|
||||||
|
class MessageStatus
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Message that is not ready to be sent
|
* Message that is not ready to be sent
|
||||||
*/
|
*/
|
||||||
case Draft = 'draft';
|
public const DRAFT = 'draft';
|
||||||
/**
|
/**
|
||||||
* Scheduled to be sent for a later time
|
* Scheduled to be sent for a later time
|
||||||
*/
|
*/
|
||||||
case Scheduled = 'scheduled';
|
public const SCHEDULED = 'scheduled';
|
||||||
/**
|
/**
|
||||||
* Picked up by the worker and starting to send
|
* Picked up by the worker and starting to send
|
||||||
*/
|
*/
|
||||||
case Processing = 'processing';
|
public const PROCESSING = 'processing';
|
||||||
/**
|
/**
|
||||||
* Sent without errors
|
* Sent without errors
|
||||||
*/
|
*/
|
||||||
case Sent = 'sent';
|
public const SENT = 'sent';
|
||||||
/**
|
/**
|
||||||
* Sent with some errors
|
* Sent with some errors
|
||||||
*/
|
*/
|
||||||
case Failed = 'failed';
|
public const FAILED = 'failed';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue