Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
10 | 2 | public function __construct(string $location, int $statusCode = 302) |
|
11 | { |
||
12 | 2 | if ($statusCode < 300 || $statusCode >= 400) { |
|
13 | 1 | throw new \InvalidArgumentException('Redirect must have status code between 300-399'); |
|
14 | } |
||
15 | |||
16 | 1 | $this->statusCode = $statusCode; |
|
17 | 1 | $this->setHeader('Location', $location); |
|
18 | } |
||
55 |