Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
HttpRedirect | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Http\Exceptions; |
6 | |
7 | class HttpRedirect extends HttpException |
8 | { |
9 | public function __construct( |
10 | string $url, |
11 | int $statusCode = 302, |
12 | array $headers = [] |
13 | ) { |
14 | $headers = array_merge([ |
15 | 'Location' => $url, |
16 | ], $headers); |
17 | |
18 | parent::__construct($statusCode, '', $headers); |
19 | } |
20 | } |