| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 8 | public function __construct(iterable $elements = []) |
|
| 24 | { |
||
| 25 | 8 | foreach ($elements as $element) { |
|
| 26 | 6 | if (!is_int($element)) { |
|
| 27 | 4 | throw new InvalidArgumentException(sprintf( |
|
| 28 | 4 | 'Expected an integer, but got: %s.', |
|
| 29 | 4 | is_object($element) ? get_class($element) : gettype($element), |
|
| 30 | )); |
||
| 31 | } |
||
| 32 | 6 | $this->elements[] = $element; |
|
| 33 | } |
||
| 71 |