| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 33 | public function getRate($symbol) |
||
| 34 | { |
||
| 35 | $this->generateRates(); |
||
| 36 | |||
| 37 | if (!array_key_exists($symbol, $this->rates)) { |
||
| 38 | throw new \Exception(sprintf('Unsupported Country Code, %s', $symbol)); |
||
| 39 | } |
||
| 40 | |||
| 41 | return (double)filter_var($this->rates[$symbol], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
||
| 42 | } |
||
| 43 | |||
| 59 |