| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class OpenPositionsResponse implements ResponseInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var OpenPositionModel[] |
||
| 16 | */ |
||
| 17 | private $positions = []; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param array $result |
||
| 21 | */ |
||
| 22 | 1 | public function manualMapping($result) |
|
| 23 | { |
||
| 24 | 1 | foreach ($result as $txId => $position) { |
|
| 25 | 1 | $this->positions[] = new OpenPositionModel( |
|
| 26 | 1 | $txId, |
|
| 27 | 1 | $position["ordertxid"], |
|
| 28 | 1 | $position["pair"], |
|
| 29 | 1 | $position["time"], |
|
| 30 | 1 | $position["type"], |
|
| 31 | 1 | $position["ordertype"], |
|
| 32 | 1 | $position["cost"], |
|
| 33 | 1 | $position["fee"], |
|
| 34 | 1 | $position["vol"], |
|
| 35 | 1 | $position["vol_closed"], |
|
| 36 | 1 | $position["margin"], |
|
| 37 | 1 | $position["value"], |
|
| 38 | 1 | $position["net"], |
|
| 39 | 1 | $position["misc"], |
|
| 40 | 1 | $position["oflags"], |
|
| 41 | 1 | $position["viqc"] |
|
| 42 | 1 | ); |
|
| 43 | 1 | } |
|
| 44 | 1 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return OpenPositionModel[] |
||
| 48 | */ |
||
| 49 | 1 | public function getPositions() |
|
| 52 | } |
||
| 53 | |||
| 55 |