1 | <?php |
||
12 | class Response implements ApplicationPsr7ResponseInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $code = IResponse::S200_OK; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $headers = []; |
||
23 | |||
24 | /** |
||
25 | * @var StreamInterface |
||
26 | */ |
||
27 | private $stream; |
||
28 | |||
29 | /** |
||
30 | * @param IRequest $httpRequest |
||
31 | * @param IResponse $httpResponse |
||
32 | * @return void |
||
33 | */ |
||
34 | public function send(IRequest $httpRequest, IResponse $httpResponse) |
||
42 | |||
43 | /** |
||
44 | * @param string $name |
||
45 | * @param string|string[] $value |
||
46 | * @return self |
||
47 | */ |
||
48 | public function withHeader($name, $value) |
||
54 | |||
55 | /** |
||
56 | * @return StreamInterface |
||
57 | */ |
||
58 | public function getBody() |
||
65 | |||
66 | /** |
||
67 | * @param int $code |
||
68 | * @param string $reasonPhrase |
||
69 | * @return self |
||
70 | */ |
||
71 | public function withStatus($code, $reasonPhrase = '') |
||
77 | |||
78 | /** |
||
79 | * @return self |
||
80 | */ |
||
81 | public function withBody(StreamInterface $body) |
||
87 | |||
88 | /** |
||
89 | * @throws NotImplementedException |
||
90 | */ |
||
91 | public function getProtocolVersion() |
||
95 | |||
96 | /** |
||
97 | * @throws NotImplementedException |
||
98 | */ |
||
99 | public function withProtocolVersion($version) |
||
103 | |||
104 | /** |
||
105 | * @throws NotImplementedException |
||
106 | */ |
||
107 | public function getHeaders() |
||
111 | |||
112 | /** |
||
113 | * @throws NotImplementedException |
||
114 | */ |
||
115 | public function hasHeader($name) |
||
119 | |||
120 | /** |
||
121 | * @throws NotImplementedException |
||
122 | */ |
||
123 | public function getHeader($name) |
||
127 | |||
128 | /** |
||
129 | * @throws NotImplementedException |
||
130 | */ |
||
131 | public function getHeaderLine($name) |
||
135 | |||
136 | /** |
||
137 | * @throws NotImplementedException |
||
138 | */ |
||
139 | public function withAddedHeader($name, $value) |
||
143 | |||
144 | /** |
||
145 | * @throws NotImplementedException |
||
146 | */ |
||
147 | public function withoutHeader($name) |
||
151 | |||
152 | /** |
||
153 | * @throws NotImplementedException |
||
154 | */ |
||
155 | public function getStatusCode() |
||
159 | |||
160 | /** |
||
161 | * @throws NotImplementedException |
||
162 | */ |
||
163 | public function getReasonPhrase() |
||
167 | |||
168 | } |
||
169 |