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