Code Duplication    Length = 5-6 lines in 2 locations

src/Generators/Prime.php 1 location

@@ 28-33 (lines=6) @@
25
   * @return \Generator
26
   */
27
  protected function get() {
28
    for ($j = 2; $j <= $this->getMaxLimit(); $j++) {
29
      if ($this->isPrimeNumber($j)) {
30
        $this->count++;
31
        yield $j;
32
      }
33
    }
34
  }
35
36
}

src/Iterators/Prime.php 1 location

@@ 90-94 (lines=5) @@
87
  public function count() {
88
    $this->count = 0;
89
90
    for ($j = 2; $j <= $this->getMaxLimit(); $j++) {
91
      if ($this->isPrimeNumber($j)) {
92
        $this->count++;
93
      }
94
    }
95
96
    return $this->count;
97
  }