| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class ServiceError |
||
| 14 | { |
||
| 15 | public const ERROR_INVALID_REQUEST = 1000000; |
||
| 16 | public const ERROR_UNEXPECTED = 1000001; |
||
| 17 | /** @var int */ |
||
| 18 | protected $code; |
||
| 19 | /** @var string */ |
||
| 20 | protected $message; |
||
| 21 | |||
| 22 | public function __construct(string $message, int $code = 0) |
||
| 23 | { |
||
| 24 | $this->message = $message; |
||
| 25 | $this->code = $code; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return int |
||
| 30 | */ |
||
| 31 | public function getCode(): int |
||
| 32 | { |
||
| 33 | return $this->code; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function getMessage(): string |
||
| 42 | } |
||
| 43 | } |
||
| 44 |