| 1 | <?php |
||
| 16 | final class JsonTransportResponse implements TransportResponseInterface |
||
| 17 | { |
||
| 18 | use ConfigurableTrait; |
||
| 19 | |||
| 20 | const UNITS_TYPE_DEBIT = 0; |
||
| 21 | const UNITS_TYPE_REST = 1; |
||
| 22 | const UNITS_TYPE_LIMIT = 2; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * TransportResponse constructor. |
||
| 26 | * |
||
| 27 | * @param array $options |
||
| 28 | */ |
||
| 29 | 1 | public function __construct(array $options) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | protected $units = [null, null, null]; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var string |
||
| 41 | */ |
||
| 42 | protected $requestId; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | protected $body; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var array |
||
| 51 | */ |
||
| 52 | protected $headers = []; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | public function getUnits() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $rawUnits |
||
| 64 | * @throws InvalidArgumentException |
||
| 65 | */ |
||
| 66 | 1 | public function setUnits($rawUnits) |
|
| 75 | |||
| 76 | /** |
||
| 77 | * @inheritdoc |
||
| 78 | */ |
||
| 79 | public function getRequestId() |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @inheritdoc |
||
| 86 | */ |
||
| 87 | public function getUnitsDebit() |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @inheritdoc |
||
| 94 | */ |
||
| 95 | public function getUnitsRest() |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @inheritdoc |
||
| 102 | */ |
||
| 103 | public function getUnitsLimit() |
||
| 107 | |||
| 108 | /** |
||
| 109 | * @inheritdoc |
||
| 110 | */ |
||
| 111 | 1 | public function getBody() |
|
| 115 | |||
| 116 | /** |
||
| 117 | * @inheritdoc |
||
| 118 | */ |
||
| 119 | 1 | public function getHeaders() |
|
| 123 | } |
||
| 124 |