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