Code Duplication    Length = 10-10 lines in 2 locations

src/Iterators/Perfect.php 1 location

@@ 47-56 (lines=10) @@
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function current()
48
    {
49
        for ($i = $this->key(); $i < $this->getMaxLimit(); $i++) {
50
            if ($this->isPerfectNumber($i)) {
51
                $this->key = $i;
52
53
                return $i;
54
            }
55
        }
56
57
        return $this->getMaxLimit();
58
    }
59

src/Iterators/Prime.php 1 location

@@ 47-56 (lines=10) @@
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function current()
48
    {
49
        for ($i = $this->key(); $i < $this->getMaxLimit(); $i++) {
50
            if ($this->isPrimeNumber($i)) {
51
                $this->key = $i;
52
53
                return $i;
54
            }
55
        }
56
57
        return $this->getMaxLimit();
58
    }
59