| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TradesHistoryResponse implements ResponseInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var int |
||
| 15 | */ |
||
| 16 | private $count; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var Trade[] |
||
| 20 | */ |
||
| 21 | private $trades; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param array $result |
||
| 25 | */ |
||
| 26 | 1 | public function manualMapping($result) |
|
| 27 | { |
||
| 28 | 1 | $this->count = $result["count"]; |
|
| 29 | 1 | foreach ($result["trades"] as $trade) { |
|
| 30 | 1 | $this->trades[] = new Trade($trade["ordertxid"], $trade["pair"], $trade["time"], $trade["type"], $trade["ordertype"], $trade["price"], $trade["cost"], $trade["fee"], $trade["vol"], $trade["margin"], $trade["misc"], $trade["closing"]); |
|
| 31 | 1 | } |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @return int |
||
| 36 | */ |
||
| 37 | 1 | public function getCount() |
|
| 38 | { |
||
| 39 | 1 | return $this->count; |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return Trade[] |
||
| 44 | */ |
||
| 45 | 1 | public function getTrades() |
|
| 48 | } |
||
| 49 | |||
| 50 | |||
| 52 |