for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mechpave\ImgurClient\Http;
use Psr\Http\Message\ResponseInterface;
/**
* Class ImgurResponse
* @package Mechpave\ImgurClient\Http
*/
class ImgurResponse implements ImgurResponseInterface
{
* Guzzle response
* @var ResponseInterface
protected $response;
* ImgurResponse constructor.
* @param ResponseInterface $response
public function __construct(ResponseInterface $response)
$this->response = $response;
}
* @inheritdoc
* @throws \Exception
public function getBody()
if (!is_callable([$this->response, 'getBody']) ||
!is_callable([$this->response->getBody(), 'getContents'])) {
throw new \Exception('Could not retrieve response body');
$body = json_decode($this->response->getBody()->getContents(), true);
if (empty($body)) {
return $body;
* @return array
public function getHeaders()
// TODO: Implement getHeaders() method.
* @return mixed
public function getRateLimit()
// TODO: Implement getRateLimit() method.