Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
41 | public function __construct(int $statusCode) |
||
42 | { |
||
43 | $reflection = new \ReflectionClass(StatusCodeInterface::class); |
||
44 | $allowedStatus = $reflection->getConstants(); |
||
45 | |||
46 | if (!\in_array($statusCode, $allowedStatus)) { |
||
47 | throw new \UnexpectedValueException('Invalid HTTP Status Code'); |
||
48 | } |
||
49 | |||
50 | $this->statusCode = $statusCode; |
||
51 | } |
||
61 |