Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 9 | public static function build(array $data): FiatCurrenciesCollection |
|
23 | { |
||
24 | 9 | $result = []; |
|
25 | 9 | if (!empty($data)) |
|
26 | { |
||
27 | 9 | foreach ($data as $item) |
|
28 | { |
||
29 | 9 | if (!is_string($item)) |
|
30 | { |
||
31 | 3 | throw new \UnexpectedValueException('Not valid item'); |
|
32 | } |
||
33 | 6 | $result[] = new FiatCurrencyObject($item); |
|
34 | } |
||
35 | } |
||
36 | 6 | return new FiatCurrenciesCollection($result); |
|
37 | } |
||
39 |