Code Duplication    Length = 6-6 lines in 2 locations

src/Zicht/Itertools/lib/ChainIterator.php 1 location

@@ 61-66 (lines=6) @@
58
    public function __construct(/* \Iterator $iterable, \Iterator $iterable2, ... */)
59
    {
60
        parent::__construct();
61
        foreach (func_get_args() as $iterable) {
62
            if (!$iterable instanceof \Iterator) {
63
                throw new \InvalidArgumentException(sprintf('Argument %d must be an Iterator'));
64
            }
65
            $this->append($iterable);
66
        }
67
    }
68
69
    /**

src/Zicht/Itertools/lib/ZipIterator.php 1 location

@@ 52-57 (lines=6) @@
49
    public function __construct(/* \Iterator $iterable1, \Iterator $iterable2, ... */)
50
    {
51
        parent::__construct(\MultipleIterator::MIT_NEED_ALL| \MultipleIterator::MIT_KEYS_NUMERIC);
52
        foreach (func_get_args() as $iterable) {
53
            if (!$iterable instanceof \Iterator) {
54
                throw new \InvalidArgumentException(sprintf('Argument %d must be an iterator'));
55
            }
56
            $this->attachIterator($iterable);
57
        }
58
        $this->key = 0;
59
    }
60