@@ -91,6 +91,8 @@ public function __construct()
9191 /**
9292 * Controls whether requests and responses should be treated
9393 * as XML. Defaults to false (using JSON).
94+ *
95+ * @param bool $option the new state of this feature
9496 */
9597 public function useXml ($ option = true )
9698 {
@@ -109,6 +111,8 @@ public function useXml($option = true)
109111 *
110112 * <p><em>Note that this doesn't use the builtin CURL_FAILONERROR option,
111113 * as this fails fast, making the HTTP body and headers inaccessible.</em></p>
114+ *
115+ * @param bool $option the new state of this feature
112116 */
113117 public function failOnError ($ option = true )
114118 {
@@ -117,6 +121,9 @@ public function failOnError($option = true)
117121
118122 /**
119123 * Sets the HTTP basic authentication.
124+ *
125+ * @param string $username
126+ * @param string $password
120127 */
121128 public function authenticate ($ username , $ password )
122129 {
@@ -137,6 +144,9 @@ public function setTimeout($timeout)
137144
138145 /**
139146 * Set a proxy server for outgoing requests to tunnel through.
147+ *
148+ * @param string $server
149+ * @param int|bool $port optional port number
140150 */
141151 public function useProxy ($ server , $ port = false )
142152 {
@@ -249,7 +259,7 @@ public function getLastError()
249259 }
250260
251261 /**
252- * Recursively follow redirect until an OK response is recieved or
262+ * Recursively follow redirect until an OK response is received or
253263 * the maximum redirects limit is reached.
254264 *
255265 * Only 301 and 302 redirects are handled. Redirects from POST and PUT requests will
@@ -260,9 +270,7 @@ private function followRedirectPath()
260270 $ this ->redirectsFollowed ++;
261271
262272 if ($ this ->getStatus () == 301 || $ this ->getStatus () == 302 ) {
263-
264273 if ($ this ->redirectsFollowed < $ this ->maxRedirects ) {
265-
266274 $ location = $ this ->getHeader ('Location ' );
267275 $ forwardTo = parse_url ($ location );
268276
@@ -286,6 +294,11 @@ private function followRedirectPath()
286294
287295 /**
288296 * Make an HTTP GET request to the specified endpoint.
297+ *
298+ * @param string $url URL to retrieve
299+ * @param array|bool $query Optional array of query string parameters
300+ *
301+ * @return mixed
289302 */
290303 public function get ($ url , $ query = false )
291304 {
@@ -305,6 +318,11 @@ public function get($url, $query = false)
305318
306319 /**
307320 * Make an HTTP POST request to the specified endpoint.
321+ *
322+ * @param string $url URL to which we send the request
323+ * @param mixed $body Data payload (JSON string or raw data)
324+ *
325+ * @return mixed
308326 */
309327 public function post ($ url , $ body )
310328 {
@@ -328,8 +346,8 @@ public function post($url, $body)
328346 /**
329347 * Make an HTTP HEAD request to the specified endpoint.
330348 *
331- * @param $url
332- * @return bool| mixed|string
349+ * @param string $url URL to which we send the request
350+ * @return mixed
333351 */
334352 public function head ($ url )
335353 {
@@ -349,9 +367,9 @@ public function head($url)
349367 * Requires a tmpfile() handle to be opened on the system, as the cURL
350368 * API requires it to send data.
351369 *
352- * @param $url
353- * @param $body
354- * @return bool| mixed|string
370+ * @param string $url URL to which we send the request
371+ * @param mixed $body Data payload (JSON string or raw data)
372+ * @return mixed
355373 */
356374 public function put ($ url , $ body )
357375 {
@@ -383,8 +401,8 @@ public function put($url, $body)
383401 /**
384402 * Make an HTTP DELETE request to the specified endpoint.
385403 *
386- * @param $url
387- * @return bool| mixed|string
404+ * @param string $url URL to which we send the request
405+ * @return mixed
388406 */
389407 public function delete ($ url )
390408 {
@@ -400,8 +418,8 @@ public function delete($url)
400418 /**
401419 * Method that appears unused, but is in fact called by curl
402420 *
403- * @param $curl
404- * @param $body
421+ * @param resource $curl
422+ * @param string $body
405423 * @return int
406424 */
407425 private function parseBody ($ curl , $ body )
@@ -413,8 +431,8 @@ private function parseBody($curl, $body)
413431 /**
414432 * Method that appears unused, but is in fact called by curl
415433 *
416- * @param $curl
417- * @param $headers
434+ * @param resource $curl
435+ * @param string $headers
418436 * @return int
419437 */
420438 private function parseHeader ($ curl , $ headers )
@@ -432,6 +450,8 @@ private function parseHeader($curl, $headers)
432450
433451 /**
434452 * Access the status code of the response.
453+ *
454+ * @return mixed
435455 */
436456 public function getStatus ()
437457 {
@@ -440,6 +460,8 @@ public function getStatus()
440460
441461 /**
442462 * Access the message string from the status line of the response.
463+ *
464+ * @return string
443465 */
444466 public function getStatusMessage ()
445467 {
@@ -448,6 +470,8 @@ public function getStatusMessage()
448470
449471 /**
450472 * Access the content body of the response
473+ *
474+ * @return string
451475 */
452476 public function getBody ()
453477 {
@@ -456,6 +480,8 @@ public function getBody()
456480
457481 /**
458482 * Access given header from the response.
483+ *
484+ * @return string|void
459485 */
460486 public function getHeader ($ header )
461487 {
0 commit comments