1 | <?php |
||
15 | class Response implements ResponseInterface |
||
16 | { |
||
17 | use ConfigurableTrait; |
||
18 | |||
19 | const UNITS_TYPE_DEBIT = 0; |
||
20 | const UNITS_TYPE_REST = 1; |
||
21 | const UNITS_TYPE_LIMIT = 2; |
||
22 | |||
23 | /** |
||
24 | * Response constructor. |
||
25 | * |
||
26 | * @param array $responseAttributes |
||
27 | */ |
||
28 | 2 | public function __construct(array $responseAttributes) |
|
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $service; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $method; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $units = [ |
||
47 | self::UNITS_TYPE_DEBIT => null, |
||
48 | self::UNITS_TYPE_LIMIT => null, |
||
49 | self::UNITS_TYPE_REST => null |
||
50 | ]; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $requestId; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $body; |
||
61 | |||
62 | /** |
||
63 | * @var int |
||
64 | */ |
||
65 | protected $code; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | protected $headers = []; |
||
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | 1 | public function getUnits() |
|
79 | |||
80 | /** |
||
81 | * @param string $rawUnits |
||
82 | */ |
||
83 | 2 | public function setUnits($rawUnits) |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 1 | public function getRequestId() |
|
102 | |||
103 | /** |
||
104 | * @inheritdoc |
||
105 | */ |
||
106 | 1 | public function getUnitsDebit() |
|
110 | |||
111 | /** |
||
112 | * @inheritdoc |
||
113 | */ |
||
114 | 1 | public function getUnitsRest() |
|
118 | |||
119 | /** |
||
120 | * @inheritdoc |
||
121 | */ |
||
122 | 1 | public function getUnitsLimit() |
|
126 | |||
127 | /** |
||
128 | * @inheritdoc |
||
129 | */ |
||
130 | 2 | public function getBody() |
|
134 | |||
135 | /** |
||
136 | * @inheritdoc |
||
137 | */ |
||
138 | 1 | public function getHeaders() |
|
142 | |||
143 | /** |
||
144 | * @inheritdoc |
||
145 | */ |
||
146 | public function getService() |
||
150 | |||
151 | /** |
||
152 | * @inheritdoc |
||
153 | */ |
||
154 | public function getMethod() |
||
158 | |||
159 | public function getCode() |
||
163 | } |
||
164 |