| Total Complexity | 7 |
| Total Lines | 76 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class ErrorCollection extends Collection implements ErrorHandledCollectionInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * The HTTP status code applicable to this problem, expressed as a string value. |
||
| 13 | * |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $statusCode; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * The HTTP headers on response. |
||
| 20 | * |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | protected $headers = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Returns the status code. |
||
| 27 | * |
||
| 28 | * @return string|null |
||
| 29 | */ |
||
| 30 | public function getStatusCode() |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Returns response headers. |
||
| 37 | * |
||
| 38 | * @return array headers |
||
| 39 | */ |
||
| 40 | public function getHeaders(): array |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Set the status code. |
||
| 47 | * |
||
| 48 | * @param string $statusCode |
||
| 49 | * |
||
| 50 | * @return self |
||
| 51 | */ |
||
| 52 | public function setStatusCode(string $statusCode) |
||
| 53 | { |
||
| 54 | $this->statusCode = $statusCode; |
||
| 55 | |||
| 56 | return $this; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Set the headers of response. |
||
| 61 | * |
||
| 62 | * @param array $headers |
||
| 63 | * |
||
| 64 | * @return self |
||
| 65 | */ |
||
| 66 | public function setHeaders(array $headers): self |
||
| 67 | { |
||
| 68 | $this->headers = $headers; |
||
| 69 | |||
| 70 | return $this; |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | */ |
||
| 76 | public function validatedContent(string $type): ErrorHandledCollectionInterface |
||
| 85 | } |
||
| 86 | } |
||
| 87 |