1 | <?php |
||
25 | class Response implements ResponseInterface |
||
26 | { |
||
27 | /** |
||
28 | * Initializes a response |
||
29 | * |
||
30 | * @param string|null $uContent method |
||
31 | * @param int|null $uStatus http status |
||
32 | * @param array|null $uHeaders headers information will be sent |
||
33 | * |
||
34 | * @return Response response object |
||
|
|||
35 | */ |
||
36 | public function __construct($uContent = null, $uStatus = null, array $uHeaders = null) |
||
40 | |||
41 | /** |
||
42 | * Sets weather request is handled or not |
||
43 | * |
||
44 | * @param bool $uHandled the status if request is handled |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function setHandled($uHandled) |
||
52 | |||
53 | /** |
||
54 | * Gets weather request is handled or not |
||
55 | * |
||
56 | * @return bool is handled |
||
57 | */ |
||
58 | public function getHandled() |
||
62 | |||
63 | /** |
||
64 | * Sets the status code and description |
||
65 | * |
||
66 | * @param int $uStatusCode the status or exit code |
||
67 | * @param string $uDescription description for the status |
||
68 | * |
||
69 | * @return void |
||
70 | */ |
||
71 | public function setStatus($uStatusCode, $uDescription) |
||
75 | |||
76 | /** |
||
77 | * Sets session id |
||
78 | * |
||
79 | * @param string $uId session id to be set |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public function setSessionId($uId) |
||
87 | |||
88 | /** |
||
89 | * Sets a session variable to be sent |
||
90 | * |
||
91 | * @param string $uKey key for the session variable |
||
92 | * @param string $uValue value for the session variable |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | public function setSession($uKey, $uValue) |
||
100 | |||
101 | /** |
||
102 | * Sends a directive to remove session variable |
||
103 | * |
||
104 | * @param string $uKey key for the session variable |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | public function removeSession($uKey) |
||
112 | |||
113 | /** |
||
114 | * Gets a session variable to be sent |
||
115 | * |
||
116 | * @param string $uKey key for the session variable |
||
117 | * |
||
118 | * @return string value |
||
119 | */ |
||
120 | public function getSession($uKey) |
||
124 | |||
125 | /** |
||
126 | * Sends a directive to destroy all session data |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | public function closeSession() |
||
134 | |||
135 | /** |
||
136 | * Sets a cookie variable to be sent |
||
137 | * |
||
138 | * @param string $uKey key for the cookie variable |
||
139 | * @param string $uValue value for the cookie variable |
||
140 | * @param int $uTtl time to live (in seconds) |
||
141 | * |
||
142 | * @return void |
||
143 | */ |
||
144 | public function setCookie($uKey, $uValue, $uTtl = 0) |
||
148 | |||
149 | /** |
||
150 | * Sends a directive to remove cookie variable |
||
151 | * |
||
152 | * @param string $uKey key for the cookie variable |
||
153 | * |
||
154 | * @return void |
||
155 | */ |
||
156 | public function removeCookie($uKey) |
||
160 | |||
161 | /** |
||
162 | * Gets a cookie variable to be sent |
||
163 | * |
||
164 | * @param string $uKey key for the cookie variable |
||
165 | * |
||
166 | * @return string value |
||
167 | */ |
||
168 | public function getCookie($uKey) |
||
172 | |||
173 | /** |
||
174 | * Sets a header to be sent |
||
175 | * |
||
176 | * @param string $uKey key for the header |
||
177 | * @param string $uValue value for the header |
||
178 | * @param bool $uReplace replace existing headers with the same name |
||
179 | * |
||
180 | * @return void |
||
181 | */ |
||
182 | public function setHeader($uKey, $uValue, $uReplace = false) |
||
186 | |||
187 | /** |
||
188 | * Removes a header to be sent |
||
189 | * |
||
190 | * @param string $uKey key for the header |
||
191 | * |
||
192 | * @return void |
||
193 | */ |
||
194 | public function removeHeader($uKey) |
||
198 | |||
199 | /** |
||
200 | * Gets a header to be sent |
||
201 | * |
||
202 | * @param string $uKey key for the header |
||
203 | * |
||
204 | * @return string value |
||
205 | */ |
||
206 | public function getHeader($uKey) |
||
210 | |||
211 | /** |
||
212 | * Sets the content |
||
213 | * |
||
214 | * @param string $uContent response context |
||
215 | * |
||
216 | * @return void |
||
217 | */ |
||
218 | public function setContent($uContent) |
||
222 | |||
223 | /** |
||
224 | * Gets the content to be sent |
||
225 | * |
||
226 | * @return string content |
||
227 | */ |
||
228 | public function getContent() |
||
232 | } |
||
233 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.