1 | <?php |
||
17 | class MvcException extends \Exception { |
||
18 | |||
19 | /** @var int[] $VALID_HTTP List of valid HTTP codes */ |
||
20 | protected static $VALID_HTTP = array( |
||
21 | 100, 101, |
||
22 | 200, 201, 202, 203, 204, 205, 206, |
||
23 | 300, 301, 302, 303, 304, 305, 306, 307, |
||
24 | 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, |
||
25 | 500, 501, 502, 503, 504, 505 |
||
26 | ); |
||
27 | |||
28 | /** @var int $http_code */ |
||
29 | protected $http_code; |
||
30 | |||
31 | /** |
||
32 | * Constructor for MvcException |
||
33 | * |
||
34 | * @param int $http_code |
||
35 | * @param string $message |
||
36 | * @param int $code |
||
37 | * @param \Throwable $previous |
||
38 | */ |
||
39 | public function __construct($http_code = 500, $message = "", $code = 0, \Throwable $previous = null) { |
||
44 | |||
45 | /** |
||
46 | * Get the HTTP code |
||
47 | * |
||
48 | * @return int |
||
49 | */ |
||
50 | public function getHttpCode() { |
||
53 | |||
54 | /** |
||
55 | * Set the HTTP code |
||
56 | * |
||
57 | * @param int $http_code |
||
58 | * @throws InvalidArgumentException Thrown if not valid Http code |
||
59 | */ |
||
60 | public function setHttpCode($http_code) { |
||
65 | |||
66 | } |
||
67 | |||
68 |