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