Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class OHLCDataResponse implements ResponseInterface |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * |
||
17 | * @var int |
||
18 | */ |
||
19 | private $last; |
||
20 | |||
21 | /** |
||
22 | * @var OHLCDataModel[] |
||
23 | */ |
||
24 | private $ohlcDataModels; |
||
25 | |||
26 | /** |
||
27 | * @param array $data |
||
28 | */ |
||
29 | public function manualMapping($data) |
||
30 | { |
||
31 | $this->last = $data["last"]; |
||
32 | |||
33 | foreach ($data as $assetPair => $assetDataArr) { |
||
34 | if ($assetPair == "last") { |
||
35 | continue; |
||
36 | } |
||
37 | |||
38 | foreach ($assetDataArr as $assetData) { |
||
39 | $this->ohlcDataModels[] = new OHLCDataModel($assetData[0], $assetData[1], $assetData[2], $assetData[3], $assetData[4], $assetData[5], $assetData[6], $assetData[7]); |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return int |
||
46 | */ |
||
47 | public function getLast() |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return OHLCDataModel[] |
||
54 | */ |
||
55 | public function getOhlcDataModels() |
||
58 | } |
||
59 | } |
||
60 |