Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 15 | public static function build($data): CryptoRateObject |
|
22 | { |
||
23 | 15 | if (!isset($data['rate'], $data['exchange'], $data['fiat'], $data['crypto'], $data['time'])) |
|
24 | { |
||
25 | 3 | throw new \UnexpectedValueException('Not valid item'); |
|
26 | } |
||
27 | 12 | return new CryptoRateObject($data['crypto'], $data['fiat'], $data['rate'], $data['time'], $data['exchange']); |
|
28 | } |
||
30 |