| Conditions | 4 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function latest(string $baseCurrency = null, array $symbols = []): ResponseInterface |
||
| 27 | { |
||
| 28 | 6 | $params = []; |
|
| 29 | if ($baseCurrency) { |
||
| 30 | 6 | if (strlen($baseCurrency) != 3) { |
|
| 31 | 6 | throw new InvalidCurrencyCodeException($baseCurrency); |
|
| 32 | 6 | } |
|
| 33 | 3 | $params['base'] = $baseCurrency; |
|
| 34 | } |
||
| 35 | 3 | ||
| 36 | if (!empty($symbols)) { |
||
| 37 | $params['symbols'] = implode(',', $symbols); |
||
| 38 | 3 | } |
|
| 39 | 3 | ||
| 40 | $req = new GetLatestExchangeRatesRequest($this->buildUri($params)); |
||
| 41 | |||
| 42 | 3 | return $this->client->send($req); |
|
| 43 | } |
||
| 45 |