Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function fromJson(string $currencyFrom, string $currencyTo, \DateTime $date, string $jsonString): Rate |
||
32 | { |
||
33 | $dataObj = json_decode($jsonString); |
||
34 | |||
35 | if (empty($dataObj->data->sum_result)) { |
||
36 | throw new NoneRateException('Service cash.rbc.ru has not send any rate data'); |
||
37 | } |
||
38 | |||
39 | return new Rate($currencyFrom, $currencyTo, $date, $dataObj->data->sum_result); |
||
40 | } |
||
42 |