| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class HeadersProvider |
||
| 14 | { |
||
| 15 | 12 | public function __construct( |
|
| 16 | private array $headers = [], |
||
| 17 | ) { |
||
| 18 | 12 | } |
|
| 19 | |||
| 20 | /** |
||
| 21 | * Adds a header to the list of headers. |
||
| 22 | * |
||
| 23 | * @param string $name The header name. |
||
| 24 | * @param string|string[] $values The header value. |
||
| 25 | */ |
||
| 26 | 1 | public function add(string $name, string|array $values): void |
|
| 27 | { |
||
| 28 | 1 | $this->headers[$name] = $values; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Returns all headers. |
||
| 33 | * |
||
| 34 | * @return array<string, string|string[]> The headers list. |
||
| 35 | */ |
||
| 36 | 9 | public function getAll(): array |
|
| 39 | } |
||
| 40 | } |
||
| 41 |