diff options
author | Elmer Thomas <elmer@ThinkingSerious.com> | 2016-09-13 09:26:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-13 09:26:57 -0700 |
commit | 55ffd690f9309e0d3331bf9e2daa4ac2eac4ab94 (patch) | |
tree | 9a94aec7e6879e6e9ffbb448782277bf4e75f582 /lib/Response.php | |
parent | 23193453f681d77adf3f4ac6981e62e26c698537 (diff) | |
parent | e5de48e78b1d2d8421562a5a424a170813c0e69c (diff) | |
download | php-http-client-3.2.0.zip php-http-client-3.2.0.tar.gz php-http-client-3.2.0.tar.bz2 |
Merge pull request #6 from misantron/refactoringv3.2.0
Library refactoring around PSR-2 / PSR-4 code standards
Diffstat (limited to 'lib/Response.php')
-rw-r--r-- | lib/Response.php | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/Response.php b/lib/Response.php new file mode 100644 index 0000000..bc04e1f --- /dev/null +++ b/lib/Response.php @@ -0,0 +1,73 @@ +<?php + +/** + * HTTP Client library + * + * PHP version 5.4 + * + * @author Matt Bernier <dx@sendgrid.com> + * @author Elmer Thomas <dx@sendgrid.com> + * @copyright 2016 SendGrid + * @license https://opensource.org/licenses/MIT The MIT License + * @version GIT: <git_id> + * @link http://packagist.org/packages/sendgrid/php-http-client + */ + +namespace SendGrid; + +/** + * Holds the response from an API call. + */ +class Response +{ + /** @var int */ + protected $statusCode; + /** @var string */ + protected $body; + /** @var array */ + protected $headers; + + /** + * Setup the response data + * + * @param int $statusCode the status code. + * @param string $body the response body. + * @param array $headers an array of response headers. + */ + public function __construct($statusCode = null, $body = null, $headers = null) + { + $this->statusCode = $statusCode; + $this->body = $body; + $this->headers = $headers; + } + + /** + * The status code + * + * @return int + */ + public function statusCode() + { + return $this->statusCode; + } + + /** + * The response body + * + * @return string + */ + public function body() + { + return $this->body; + } + + /** + * The response headers + * + * @return array + */ + public function headers() + { + return $this->headers; + } +}
\ No newline at end of file |