| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function getRates() |
||
| 23 | { |
||
| 24 | $rates = []; |
||
| 25 | $xml = @simplexml_load_file('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'); |
||
| 26 | $data = $xml->xpath('//gesmes:Envelope/*[3]/*'); |
||
| 27 | foreach ($data[0]->children() as $child) { |
||
| 28 | $code = (string)$child->attributes()->currency; |
||
| 29 | $rate = (float)$child->attributes()->rate; |
||
| 30 | $rates[$code] = $rate; |
||
| 31 | } |
||
| 32 | |||
| 33 | return $rates; |
||
| 34 | } |
||
| 35 | |||
| 45 |