1 | <?php |
||
32 | class SoapResponse extends Response |
||
33 | { |
||
34 | /** |
||
35 | * @var mixed The content to send back with this response. |
||
36 | */ |
||
37 | protected $content = null; |
||
38 | |||
39 | /** |
||
40 | * @var array An array of SOAP headers to send with the response. |
||
41 | */ |
||
42 | protected $soapHeaders = array(); |
||
43 | |||
44 | /** |
||
45 | * Import response metadata (SOAP headers) from another response. |
||
46 | * |
||
47 | * @param Response $otherResponse The other response to import information from. |
||
48 | * |
||
49 | * @author David Zülke <[email protected]> |
||
50 | * @since 0.11.0 |
||
51 | */ |
||
52 | public function merge(Response $otherResponse) |
||
64 | |||
65 | /** |
||
66 | * Redirect externally. Not implemented here. |
||
67 | * |
||
68 | * @param mixed $to Where to redirect. |
||
69 | * |
||
70 | * @throws \BadMethodCallException |
||
71 | * |
||
72 | * @author David Zülke <[email protected]> |
||
73 | * @since 0.11.0 |
||
74 | */ |
||
75 | public function setRedirect($to) |
||
79 | |||
80 | /** |
||
81 | * Get info about the set redirect. Not implemented here. |
||
82 | * |
||
83 | * @return array An assoc array of redirect info, or null if none set. |
||
84 | * |
||
85 | * @throws \BadMethodCallException |
||
86 | * |
||
87 | * @author David Zülke <[email protected]> |
||
88 | * @since 0.11.0 |
||
89 | */ |
||
90 | public function getRedirect() |
||
94 | |||
95 | /** |
||
96 | * Check if a redirect is set. Not implemented here. |
||
97 | * |
||
98 | * @return bool true, if a redirect is set, otherwise false |
||
99 | * |
||
100 | * @throws \BadMethodCallException |
||
101 | * |
||
102 | * @author David Zülke <[email protected]> |
||
103 | * @since 0.11.0 |
||
104 | */ |
||
105 | public function hasRedirect() |
||
109 | |||
110 | /** |
||
111 | * Clear any set redirect information. Not implemented here. |
||
112 | * |
||
113 | * @throws \BadMethodCallException |
||
114 | * |
||
115 | * @author David Zülke <[email protected]> |
||
116 | * @since 0.11.0 |
||
117 | */ |
||
118 | public function clearRedirect() |
||
122 | |||
123 | /** |
||
124 | * @see Response::isMutable() |
||
125 | * |
||
126 | * @author David Zülke <[email protected]> |
||
127 | * @since 0.11.0 |
||
128 | */ |
||
129 | public function isContentMutable() |
||
133 | |||
134 | /** |
||
135 | * Clear the content for this Response |
||
136 | * |
||
137 | * @return bool Whether or not the operation was successful. |
||
138 | * |
||
139 | * @author David Zülke <[email protected]> |
||
140 | * @since 0.11.0 |
||
141 | */ |
||
142 | public function clearContent() |
||
147 | |||
148 | /** |
||
149 | * Send all response data to the client. |
||
150 | * |
||
151 | * @author David Zülke <[email protected]> |
||
152 | * @since 0.11.0 |
||
153 | */ |
||
154 | public function send(OutputType $outputType = null) |
||
160 | |||
161 | /** |
||
162 | * Clear all response data. |
||
163 | * |
||
164 | * @author David Zülke <[email protected]> |
||
165 | * @since 0.11.0 |
||
166 | */ |
||
167 | public function clear() |
||
172 | |||
173 | /** |
||
174 | * Clear all SOAP headers from the response. |
||
175 | * |
||
176 | * @author David Zülke <[email protected]> |
||
177 | * @since 0.11.0 |
||
178 | */ |
||
179 | public function clearSoapHeaders() |
||
183 | |||
184 | /** |
||
185 | * Send SOAP Headers. |
||
186 | * |
||
187 | * @author David Zülke <[email protected]> |
||
188 | * @since 0.11.0 |
||
189 | */ |
||
190 | public function sendSoapHeaders() |
||
198 | |||
199 | /** |
||
200 | * Get an array of all SOAP headers set on this response. |
||
201 | * |
||
202 | * @return array An array of SoapHeader objects. |
||
203 | * |
||
204 | * @author David Zülke <[email protected]> |
||
205 | * @since 0.11.0 |
||
206 | */ |
||
207 | public function getSoapHeaders() |
||
211 | |||
212 | /** |
||
213 | * Get a SOAP Header from this response based on its namespace and name. |
||
214 | * |
||
215 | * @param string $namespace The namespace of the SOAP header element. |
||
216 | * @param string $name The name of the SOAP header element. |
||
217 | * |
||
218 | * @return \SoapHeader A SoapHeader, if found, otherwise null. |
||
219 | * |
||
220 | * @author David Zülke <[email protected]> |
||
221 | * @since 0.11.0 |
||
222 | */ |
||
223 | public function getSoapHeader($namespace, $name) |
||
229 | |||
230 | /** |
||
231 | * Add a SOAP Header to this response. |
||
232 | * |
||
233 | * @param \SoapHeader $soapHeader The SOAP header to set. |
||
234 | * |
||
235 | * @author David Zülke <[email protected]> |
||
236 | * @since 0.11.0 |
||
237 | */ |
||
238 | public function addSoapHeader(\SoapHeader $soapHeader) |
||
243 | |||
244 | /** |
||
245 | * Set a SOAP header into this response. |
||
246 | * |
||
247 | * This method has the same signature as PHP's SoapHeader->__construct(). |
||
248 | * |
||
249 | * @param string $namespace The namespace of the SOAP header element. |
||
250 | * @param string $name The name of the SOAP header element. |
||
251 | * @param mixed $data A SOAP header's content. It can be a PHP value or a |
||
252 | * SoapVar object. |
||
253 | * @param bool $mustUnderstand Value of the mustUnderstand attribute of the SOAP header |
||
254 | * element. |
||
255 | * @param mixed $actor Value of the actor attribute of the SOAP header element. |
||
256 | * |
||
257 | * @author David Zülke <[email protected]> |
||
258 | * @since 0.11.0 |
||
259 | */ |
||
260 | public function setSoapHeader($namespace, $name, $data = null, $mustUnderstand = false, $actor = null) |
||
269 | |||
270 | /** |
||
271 | * Remove a SOAP Header from this response based on its namespace and name. |
||
272 | * |
||
273 | * @param string $namespace The namespace of the SOAP header element. |
||
274 | * @param string $name The name of the SOAP header element. |
||
275 | * |
||
276 | * @author David Zülke <[email protected]> |
||
277 | * @since 0.11.0 |
||
278 | */ |
||
279 | public function removeSoapHeader($namespace, $name) |
||
285 | |||
286 | /** |
||
287 | * Check if a SOAP Header has been set based on its namespace and name. |
||
288 | * |
||
289 | * @param string $namespace The namespace of the SOAP header element. |
||
290 | * @param string $name The name of the SOAP header element. |
||
291 | * |
||
292 | * @return bool true, if this SOAP header has been set, false otherwise. |
||
293 | * |
||
294 | * @author David Zülke <[email protected]> |
||
295 | * @since 0.11.0 |
||
296 | */ |
||
297 | public function hasSoapHeader($namespace, $name) |
||
301 | |||
302 | /** |
||
303 | * Find the key of a SOAP Header based on its namespace and name. |
||
304 | * |
||
305 | * @param string $namespace The namespace of the SOAP header element. |
||
306 | * @param string $name The name of the SOAP header element. |
||
307 | * |
||
308 | * @return int The key of the SOAP header in the array, otherwise false. |
||
309 | * |
||
310 | * @author David Zülke <[email protected]> |
||
311 | * @since 0.11.0 |
||
312 | */ |
||
313 | protected function searchSoapHeader($namespace, $name) |
||
322 | } |
||
323 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.