Code Duplication    Length = 14-14 lines in 2 locations

src/IPv4/IPv4Interval.php 1 location

@@ 289-302 (lines=14) @@
286
     *
287
     * @return \Generator
288
     */
289
    public function iterate($step = 1)
290
    {
291
        $end = $this->endPoint()->value();
292
        $ip = $this->startPoint()->value();
293
294
        if ($this->type->startExcluded()) {
295
            $ip += $step;
296
        }
297
298
        while ($ip < $end || (!$this->type->endExcluded() && $ip == $end)) {
299
            yield long2ip($ip);
300
            $ip += $step;
301
        }
302
    }
303
304
    /**
305
     * @return IntervalType

src/Number/NumberInterval.php 1 location

@@ 289-302 (lines=14) @@
286
     *
287
     * @return \Generator
288
     */
289
    public function iterate($step = 1)
290
    {
291
        $end = $this->end();
292
        $number = $this->start();
293
294
        if ($this->type->startExcluded()) {
295
            $number += $step;
296
        }
297
298
        while ($number < $end || (!$this->type->endExcluded() && $number == $end)) {
299
            yield $number;
300
            $number += $step;
301
        }
302
    }
303
304
    /**
305
     * @return IntervalType