Total Complexity | 6 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class SpreadDataResponse implements ResponseInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $last; |
||
18 | /** |
||
19 | * @var SpreadDataModel[] |
||
20 | */ |
||
21 | private $spreads; |
||
22 | |||
23 | /** |
||
24 | * @param array $result |
||
25 | */ |
||
26 | 3 | public function manualMapping($result) |
|
27 | { |
||
28 | 3 | $this->last = $result["last"]; |
|
29 | 3 | foreach ($result as $assetPair => $assetData) { |
|
30 | 3 | if ($assetPair == "last") { |
|
31 | 3 | continue; |
|
32 | } |
||
33 | 3 | foreach ($assetData as $data) { |
|
34 | 3 | $this->spreads[] = new SpreadDataModel($data[0], $data[1], $data[2]); |
|
35 | 3 | } |
|
36 | 3 | } |
|
37 | 3 | } |
|
38 | |||
39 | /** |
||
40 | * @return int |
||
41 | */ |
||
42 | 1 | public function getLast() |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return SpreadDataModel[] |
||
49 | */ |
||
50 | 1 | public function getSpreads() |
|
55 |