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