| 1 | <?php |
||
| 8 | class Exception extends \Exception implements HttpExceptionInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | protected $headers = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $message; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var integer |
||
| 22 | */ |
||
| 23 | protected $status; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Constructor. |
||
| 27 | * |
||
| 28 | * @param integer $status |
||
| 29 | * @param string $message |
||
| 30 | * @param \Exception $previous |
||
| 31 | * @param array $headers |
||
| 32 | * @param integer $code |
||
| 33 | */ |
||
| 34 | 66 | public function __construct( |
|
| 35 | $status, |
||
| 36 | $message = null, |
||
| 37 | \Exception $previous = null, |
||
| 38 | array $headers = [], |
||
| 39 | $code = 0 |
||
| 40 | ) { |
||
| 41 | 66 | $this->headers = $headers; |
|
| 42 | 66 | $this->message = $message; |
|
| 43 | 66 | $this->status = $status; |
|
| 44 | |||
| 45 | 66 | parent::__construct($message, $code, $previous); |
|
| 46 | 66 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | 54 | public function getStatusCode() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | 3 | public function getHeaders() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | */ |
||
| 67 | 60 | public function buildJsonResponse(ResponseInterface $response) |
|
| 84 | } |
||
| 85 |