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