| 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 |
||
| 19 | 9 | public static function build(array $data): CryptoExchangesCollection |
|
| 20 | { |
||
| 21 | 9 | $result = []; |
|
| 22 | 9 | if (!empty($data)) |
|
| 23 | { |
||
| 24 | 9 | foreach ($data as $item) |
|
| 25 | { |
||
| 26 | 9 | if (!is_string($item)) |
|
| 27 | { |
||
| 28 | 3 | throw new \UnexpectedValueException('Not valid item'); |
|
| 29 | } |
||
| 30 | 6 | $result[] = new CryptoExchangeObject($item); |
|
| 31 | } |
||
| 32 | } |
||
| 33 | 6 | return new CryptoExchangesCollection($result); |
|
| 34 | } |
||
| 36 |