Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
18 | 8 | public function getExchangeRates($date = null) |
|
19 | { |
||
20 | 8 | $keyIndex = 3; |
|
21 | 8 | $rates = $this->getData($date, $keyIndex); |
|
22 | 8 | $returnRates = []; |
|
23 | 8 | $rounding = 3; |
|
24 | |||
25 | 8 | foreach ($rates as $key => $rate) |
|
26 | { |
||
27 | 8 | if (sizeof($rate) >= 4) |
|
28 | 8 | { |
|
29 | 8 | $returnRates[$key] = [ |
|
30 | 8 | 'country' => $rate[0], |
|
31 | 8 | 'currency' => $rate[1], |
|
32 | 8 | 'base' => intval($rate[2]), |
|
33 | 8 | 'symbol' => $rate[3], |
|
34 | 8 | 'rate' => $this->priceStringToFloat($rate[4], $rounding), |
|
35 | ]; |
||
36 | 8 | } |
|
37 | 8 | } |
|
38 | |||
39 | 8 | return $returnRates; |
|
40 | } |
||
41 | |||
60 | } |