Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class CryptoExchangesCollection extends Collection |
||
15 | { |
||
16 | /** |
||
17 | * CryptoRatesCollection constructor. |
||
18 | * @param array $data |
||
19 | */ |
||
20 | 24 | public function __construct(array $data = []) |
|
21 | { |
||
22 | 24 | if ($this->check($data)) |
|
23 | { |
||
24 | 12 | parent::__construct($data); |
|
25 | } |
||
26 | else |
||
|
|||
27 | { |
||
28 | 12 | throw new \InvalidArgumentException('Item from array must be instance of CryptoExchangeObject'); |
|
29 | } |
||
30 | 12 | } |
|
31 | |||
32 | /** |
||
33 | * @param array $data |
||
34 | * @return bool |
||
35 | */ |
||
36 | 24 | private function check(array $data): bool |
|
49 | } |
||
50 | } |
||
51 |