diff options
Diffstat (limited to 'lib/SparkPost/Response.php')
-rw-r--r-- | lib/SparkPost/Response.php | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/SparkPost/Response.php b/lib/SparkPost/Response.php deleted file mode 100644 index c2751b6..0000000 --- a/lib/SparkPost/Response.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace SparkPost; - -use Psr\Http\Message\ResponseInterface as ResponseInterface; -use GuzzleHttp\Psr7\Response as HttpResponse; -use GuzzleHttp\Psr7\MessageTrait; - -class Response implements ResponseInterface { - - use MessageTrait; - - private $response; - - public function __construct(HttpResponse $response) { - $this->response = $response; - } - - public function getBody() - { - $body = $this->response->getBody(); - $body_string = $body->__toString(); - - if (is_string($body_string)) { - $json = json_decode($body_string, true); - - if (json_last_error() == JSON_ERROR_NONE) { - return $json; - } - else { - return $body; - } - } - - return $body; - } - - public function getStatusCode() - { - return $this->response->getStatusCode(); - } - - public function withStatus($code, $reasonPhrase = '') - { - return $this->response->withStatus($code, $reasonPhrase); - } - - public function getReasonPhrase() - { - $this->response->getReasonPhrase(); - } - -} - -?>
\ No newline at end of file |