| Total Complexity | 7 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ErrorCollection extends Collection |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The HTTP status code applicable to this problem, expressed as a string value. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $statusCode; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The HTTP headers on response. |
||
| 18 | * |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | protected $headers = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Returns the status code. |
||
| 25 | * |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | public function getStatusCode() |
||
| 29 | { |
||
| 30 | return $this->statusCode; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Returns response headers. |
||
| 35 | * |
||
| 36 | * @return array headers |
||
| 37 | */ |
||
| 38 | public function getHeaders() |
||
| 39 | { |
||
| 40 | return $this->headers; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Set the status code. |
||
| 45 | * |
||
| 46 | * @param string $statusCode |
||
| 47 | * |
||
| 48 | * @return self |
||
| 49 | */ |
||
| 50 | public function setStatusCode(string $statusCode) |
||
| 51 | { |
||
| 52 | $this->statusCode = $statusCode; |
||
| 53 | |||
| 54 | return $this; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Set the headers of response. |
||
| 59 | * |
||
| 60 | * @param array $headers |
||
| 61 | * @return self |
||
| 62 | */ |
||
| 63 | public function setHeaders(array $headers) |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Validate the content of items. All item should to be an instances of Error. |
||
| 72 | * |
||
| 73 | * @return self |
||
| 74 | * |
||
| 75 | * @throws \SMartins\Exceptions\JsonApi\InvalidContentException |
||
| 76 | */ |
||
| 77 | public function validated() |
||
| 86 | } |
||
| 87 | } |
||
| 88 |