Total Complexity | 6 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
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 | 1 | public function manualMapping($data) |
|
30 | { |
||
31 | 1 | $this->last = $data["last"]; |
|
32 | |||
33 | 1 | foreach ($data as $assetPair => $assetDataArr) { |
|
34 | 1 | if ($assetPair == "last") { |
|
35 | 1 | continue; |
|
36 | } |
||
37 | |||
38 | 1 | foreach ($assetDataArr as $assetData) { |
|
39 | 1 | $this->ohlcDataModels[] = new OHLCDataModel($assetData[0], $assetData[1], $assetData[2], $assetData[3], |
|
40 | 1 | $assetData[4], $assetData[5], $assetData[6], $assetData[7]); |
|
41 | 1 | } |
|
42 | 1 | } |
|
43 | 1 | } |
|
44 | |||
45 | /** |
||
46 | * @return int |
||
47 | */ |
||
48 | 1 | public function getLast() |
|
49 | { |
||
50 | 1 | return $this->last; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return OHLCDataModel[] |
||
55 | */ |
||
56 | 1 | public function getOhlcDataModels() |
|
59 | } |
||
60 | } |
||
61 |