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