| 1 | <?php |
||
| 5 | class ErrorResponse extends Response |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | protected $statusText = 'error'; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int|null |
||
| 14 | */ |
||
| 15 | protected $code = null; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string|null |
||
| 19 | */ |
||
| 20 | protected $message = null; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param int $code |
||
| 24 | * @return $this |
||
| 25 | */ |
||
| 26 | public function withCode($code) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | public function hasMessage() |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public function hasCode() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param string $message |
||
| 51 | * @return $this |
||
| 52 | */ |
||
| 53 | public function withMessage($message) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return array |
||
| 62 | */ |
||
| 63 | public function toArray() |
||
| 77 | } |
||
| 78 |