| 1 | <?php |
||
| 15 | abstract class HTTPException extends Exception implements HttpExceptionInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The exception's message |
||
| 19 | * @var null|string |
||
| 20 | */ |
||
| 21 | protected $message = null; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Construct new Exception |
||
| 25 | * @param null|string $message The Exception's message |
||
| 26 | * (null for the default one) |
||
| 27 | * @param int $code The Exception's code |
||
| 28 | * @param Exception $previous The previous exception |
||
| 29 | */ |
||
| 30 | 1 | public function __construct( |
|
| 31 | $message = null, |
||
| 32 | $code = 0, |
||
| 33 | Exception $previous = null |
||
| 34 | ) { |
||
| 35 | 1 | if ($message === null) { |
|
| 36 | // Workaround for HHVM that doesn't support shadowing of properties |
||
| 37 | // for Exceptions |
||
| 38 | $message = $this->message; |
||
| 39 | } |
||
| 40 | |||
| 41 | 1 | return parent::__construct($message, $code, $previous); |
|
|
|
|||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * The HTTP error code that the response should include |
||
| 46 | * @return int |
||
| 47 | */ |
||
| 48 | public function getStatusCode() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Headers to be included in the response |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 1 | public function getHeaders() |
|
| 61 | } |
||
| 62 |