| 1 | <?php namespace Arcanedev\Stripe\Http; |
||
| 11 | class Response implements ResponseContract |
||
| 12 | { |
||
| 13 | /* ------------------------------------------------------------------------------------------------ |
||
| 14 | | Properties |
||
| 15 | | ------------------------------------------------------------------------------------------------ |
||
| 16 | */ |
||
| 17 | protected $body; |
||
| 18 | protected $code; |
||
| 19 | protected $headers; |
||
| 20 | protected $json; |
||
| 21 | |||
| 22 | /* ------------------------------------------------------------------------------------------------ |
||
| 23 | | Constructor |
||
| 24 | | ------------------------------------------------------------------------------------------------ |
||
| 25 | */ |
||
| 26 | /** |
||
| 27 | * Make Response instance. |
||
| 28 | * |
||
| 29 | * @param string $body |
||
| 30 | * @param int $code |
||
| 31 | * @param array|null $headers |
||
| 32 | * @param array|null $json |
||
| 33 | */ |
||
| 34 | 396 | public function __construct($body, $code, $headers, $json) |
|
| 41 | |||
| 42 | /* ------------------------------------------------------------------------------------------------ |
||
| 43 | | Getters & Setters |
||
| 44 | | ------------------------------------------------------------------------------------------------ |
||
| 45 | */ |
||
| 46 | /** |
||
| 47 | * Get response body. |
||
| 48 | * |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 2 | public function getBody() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Get response status code. |
||
| 58 | * |
||
| 59 | * @return int |
||
| 60 | */ |
||
| 61 | 8 | public function getCode() |
|
| 65 | |||
| 66 | /** |
||
| 67 | * Get response status code. |
||
| 68 | * |
||
| 69 | * @return int |
||
| 70 | */ |
||
| 71 | 6 | public function getStatusCode() |
|
| 75 | |||
| 76 | /** |
||
| 77 | * Get response header. |
||
| 78 | * |
||
| 79 | * @return array|null |
||
| 80 | */ |
||
| 81 | 2 | public function getHeaders() |
|
| 85 | |||
| 86 | /** |
||
| 87 | * Get response json. |
||
| 88 | * |
||
| 89 | * @return array|null |
||
| 90 | */ |
||
| 91 | 388 | public function getJson() |
|
| 95 | } |
||
| 96 |