| Total Complexity | 8 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 5 | class Response |
||
| 6 | { |
||
| 7 | public function __construct( |
||
| 8 | private readonly array $headers, |
||
| 9 | private readonly string $requestedUrl, |
||
| 10 | private readonly ?int $statusCode, |
||
| 11 | private readonly array|string $body, |
||
| 12 | ) |
||
| 13 | { |
||
| 14 | } |
||
| 15 | |||
| 16 | public function getHeader(string $name, $default = null): mixed |
||
| 17 | { |
||
| 18 | return $this->headers[$name] ?? $default; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getHeaders(): array |
||
| 24 | } |
||
| 25 | |||
| 26 | public function hasHeader(string $name): bool |
||
| 27 | { |
||
| 28 | return isset($this->headers[$name]); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getBody(): array|string |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getRequestedUrl(): string |
||
| 37 | { |
||
| 38 | return $this->requestedUrl; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function hasBody(): bool |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getHttpResponseCode(): ?int |
||
| 49 | } |
||
| 50 | } |
||
| 51 |