| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 38 | public function __construct(int $statusCode) |
||
| 39 | { |
||
| 40 | $this->statusCode = $statusCode; |
||
| 41 | |||
| 42 | $reflection = new \ReflectionClass(StatusCodeInterface::class); |
||
| 43 | $allowedStatus = $reflection->getConstants(); |
||
| 44 | |||
| 45 | if (!\in_array($this->statusCode, $allowedStatus)) { |
||
| 46 | throw new \UnexpectedValueException('Invalid HTTP Status Code'); |
||
| 47 | } |
||
| 59 |