src/Zicht/Itertools/lib/ChainIterator.php 1 location
|
@@ 19-24 (lines=6) @@
|
16 |
|
public function __construct() |
17 |
|
{ |
18 |
|
parent::__construct(); |
19 |
|
foreach (func_get_args() as $iterable) { |
20 |
|
if (!$iterable instanceof \Iterator) { |
21 |
|
throw new \InvalidArgumentException(sprintf('Not all arguments are iterators')); |
22 |
|
} |
23 |
|
$this->append($iterable); |
24 |
|
} |
25 |
|
} |
26 |
|
|
27 |
|
/** |
src/Zicht/Itertools/lib/ZipIterator.php 1 location
|
@@ 21-26 (lines=6) @@
|
18 |
|
public function __construct() |
19 |
|
{ |
20 |
|
parent::__construct(\MultipleIterator::MIT_NEED_ALL | \MultipleIterator::MIT_KEYS_NUMERIC); |
21 |
|
foreach (func_get_args() as $iterable) { |
22 |
|
if (!$iterable instanceof \Iterator) { |
23 |
|
throw new \InvalidArgumentException(sprintf('Not all arguments are iterators')); |
24 |
|
} |
25 |
|
$this->attachIterator($iterable); |
26 |
|
} |
27 |
|
$this->key = 0; |
28 |
|
} |
29 |
|
|