Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
HttpError | |
66.67% |
2 / 3 |
|
50.00% |
1 / 2 |
2.15 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | class HttpError extends Exception { |
4 | private string $title = ''; |
5 | |
6 | public function __construct(string $message = '', int $code = 500, string $title = '', ?Throwable $previous = null) { |
7 | $this->title = $title; |
8 | // TODO check for valid http codes |
9 | parent::__construct($message, $code, $previous); |
10 | } |
11 | |
12 | public function getTitle() { |
13 | return $this->title; |
14 | } |
15 | } |