| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Status |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string[] |
||
| 9 | */ |
||
| 10 | private static array $codes = [ |
||
| 11 | '0' => 'Success', |
||
| 12 | '2000' => 'General error', |
||
| 13 | '15000' => 'Must change USERPASS', |
||
| 14 | '15500' => 'Signon invalid', |
||
| 15 | '15501' => 'Customer account already in use', |
||
| 16 | '15502' => 'USERPASS Lockout' |
||
| 17 | ]; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public string $code; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | public string $severity; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | public string $message; |
||
| 33 | |||
| 34 | public function __construct(string $code, string $severity, string $message) |
||
| 35 | { |
||
| 36 | $this->code = $code; |
||
| 37 | $this->severity = $severity; |
||
| 38 | $this->message = $message; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the associated code description |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function codeDescription(): string |
||
| 50 | } |
||
| 51 | } |