Skip to content

Commit

Permalink
Adding inline docblocks to assign the Response object properly for ID…
Browse files Browse the repository at this point in the history
…E's.
  • Loading branch information
wtfzdotnet committed Jan 26, 2014
1 parent 8661182 commit 2fdb933
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Tmdb/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
namespace Tmdb\Api;

use Guzzle\Http\Message\Response;
use Tmdb\Client;

abstract class AbstractApi
Expand Down Expand Up @@ -44,6 +45,9 @@ public function __construct(Client $client)
*/
public function get($path, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->get($path, $parameters, $headers);
return $response->json();
}
Expand All @@ -58,6 +62,9 @@ public function get($path, array $parameters = array(), $headers = array())
*/
public function head($path, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->head($path, $parameters, $headers);
return $response->json();
}
Expand All @@ -73,6 +80,9 @@ public function head($path, array $parameters = array(), $headers = array())
*/
public function post($path, $postBody = null, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->post($path, $postBody, $parameters, $headers);
return $response->json();
}
Expand All @@ -88,6 +98,9 @@ public function post($path, $postBody = null, array $parameters = array(), $head
*/
public function put($path, $body = null, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->put($path, $body, $parameters, $headers);
return $response->json();
}
Expand All @@ -103,6 +116,9 @@ public function put($path, $body = null, array $parameters = array(), $headers =
*/
public function delete($path, $body = null, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->delete($path, $body, $parameters, $headers);
return $response->json();
}
Expand All @@ -118,6 +134,9 @@ public function delete($path, $body = null, array $parameters = array(), $header
*/
public function patch($path, $body = null, array $parameters = array(), $headers = array())
{
/**
* @var Response $response
*/
$response = $this->client->getHttpClient()->patch($path, $body, $parameters, $headers);
return $response->json();
}
Expand Down

0 comments on commit 2fdb933

Please sign in to comment.