Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Automation_Exception | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Defines Jetpack CRM Automation exceptions. |
| 4 | * |
| 5 | * @package automattic/jetpack-crm |
| 6 | * @since 6.2.0 |
| 7 | */ |
| 8 | |
| 9 | namespace Automattic\Jetpack\CRM\Automation; |
| 10 | |
| 11 | /** |
| 12 | * Adds the Automation_Exception class. |
| 13 | * |
| 14 | * @since 6.2.0 |
| 15 | */ |
| 16 | class Automation_Exception extends \Exception { |
| 17 | |
| 18 | /** |
| 19 | * Step class not found code. |
| 20 | * |
| 21 | * @since 6.2.0 |
| 22 | * @var int |
| 23 | */ |
| 24 | const STEP_CLASS_NOT_FOUND = 10; |
| 25 | |
| 26 | /** |
| 27 | * Step slug exists code. |
| 28 | * |
| 29 | * @since 6.2.0 |
| 30 | * @var int |
| 31 | */ |
| 32 | const STEP_SLUG_EXISTS = 11; |
| 33 | |
| 34 | /** |
| 35 | * Step slug empty code. |
| 36 | * |
| 37 | * @since 6.2.0 |
| 38 | * @var int |
| 39 | */ |
| 40 | const STEP_SLUG_EMPTY = 12; |
| 41 | |
| 42 | /** |
| 43 | * Trigger class not found code. |
| 44 | * |
| 45 | * @since 6.2.0 |
| 46 | * @var int |
| 47 | */ |
| 48 | const TRIGGER_CLASS_NOT_FOUND = 20; |
| 49 | |
| 50 | /** |
| 51 | * Trigger slug exists code. |
| 52 | * |
| 53 | * @since 6.2.0 |
| 54 | * @var int |
| 55 | */ |
| 56 | const TRIGGER_SLUG_EXISTS = 21; |
| 57 | |
| 58 | /** |
| 59 | * Trigger slug empty code. |
| 60 | * |
| 61 | * @since 6.2.0 |
| 62 | * @var int |
| 63 | */ |
| 64 | const TRIGGER_SLUG_EMPTY = 22; |
| 65 | |
| 66 | /** |
| 67 | * Condition invalid operator code. |
| 68 | * |
| 69 | * @since 6.2.0 |
| 70 | * @var int |
| 71 | */ |
| 72 | const CONDITION_INVALID_OPERATOR = 30; |
| 73 | |
| 74 | /** |
| 75 | * Condition operator not implemented code. |
| 76 | * |
| 77 | * @since 6.2.0 |
| 78 | * @var int |
| 79 | */ |
| 80 | const CONDITION_OPERATOR_NOT_IMPLEMENTED = 31; |
| 81 | |
| 82 | /** |
| 83 | * General error code. |
| 84 | * |
| 85 | * @since 6.2.0 |
| 86 | * @var int |
| 87 | */ |
| 88 | const GENERAL_ERROR = 999; |
| 89 | |
| 90 | /** |
| 91 | * Automation_Exception constructor. |
| 92 | * |
| 93 | * @since 6.2.0 |
| 94 | * |
| 95 | * @param string $message Allows an exception message to be passed. |
| 96 | * @param int $code The error code to be included in the exception output. |
| 97 | */ |
| 98 | public function __construct( $message = 'Automation Exception', $code = self::GENERAL_ERROR ) { // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found |
| 99 | parent::__construct( $message, $code ); |
| 100 | } |
| 101 | } |