Conditions | 4 |
Paths | 5 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | 5 | public static function from(array $items) |
|
15 | { |
||
16 | 5 | foreach ($items as $item) { |
|
17 | 4 | if (false === $item instanceof Sample) { |
|
18 | 1 | throw new \InvalidArgumentException('All elements must be of type Sample.'); |
|
19 | } |
||
20 | 4 | } |
|
21 | |||
22 | 4 | if (0 === count($items)) { |
|
23 | 1 | throw new \InvalidArgumentException('There must be at least one element.'); |
|
24 | } |
||
25 | |||
26 | 3 | return parent::from($items); |
|
27 | } |
||
52 |