Enum.php
5 years ago
EnumInterface.php
5 years ago
LogCategory.php
5 years ago
LogType.php
5 years ago
LogType.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Log\ValueObjects; |
| 4 | |
| 5 | /** |
| 6 | * Class LogType |
| 7 | * @package Give\Log\ValueObjects |
| 8 | * |
| 9 | * @since 2.10.0 |
| 10 | * |
| 11 | * @method static ERROR() |
| 12 | * @method static WARNING() |
| 13 | * @method static NOTICE() |
| 14 | * @method static SUCCESS() |
| 15 | * @method static INFO() |
| 16 | * @method static HTTP() |
| 17 | * @method static SPAM() |
| 18 | */ |
| 19 | class LogType extends Enum { |
| 20 | const ERROR = 'error'; |
| 21 | const WARNING = 'warning'; |
| 22 | const NOTICE = 'notice'; |
| 23 | const SUCCESS = 'success'; |
| 24 | const INFO = 'info'; |
| 25 | const HTTP = 'http'; |
| 26 | const SPAM = 'spam'; |
| 27 | |
| 28 | /** |
| 29 | * @inheritDoc |
| 30 | */ |
| 31 | public static function getDefault() { |
| 32 | return LogType::ERROR; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Get types translated |
| 37 | * |
| 38 | * @return array |
| 39 | */ |
| 40 | public static function getTypesTranslated() { |
| 41 | return [ |
| 42 | self::ERROR => esc_html__( 'Error', 'give' ), |
| 43 | self::WARNING => esc_html__( 'Warning', 'give' ), |
| 44 | self::NOTICE => esc_html__( 'Notice', 'give' ), |
| 45 | self::SUCCESS => esc_html__( 'Success', 'give' ), |
| 46 | self::INFO => esc_html__( 'Info', 'give' ), |
| 47 | self::HTTP => esc_html__( 'HTTP', 'give' ), |
| 48 | self::SPAM => esc_html__( 'Spam', 'give' ), |
| 49 | ]; |
| 50 | } |
| 51 | } |
| 52 |