Passed
Push — master ( a2fa16...8a4497 )
by Pol
11:27
created

Prime::get()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 4
nc 3
nop 0
crap 12
1
<?php
2
3
declare(strict_types=1);
4
5
namespace drupol\phpermutations\Generators;
6
7
use drupol\phpermutations\GeneratorInterface;
8
use drupol\phpermutations\Iterators\Prime as PrimeIterator;
9
10
/**
11
 * Class Prime.
12
 */
13
class Prime extends PrimeIterator implements GeneratorInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function generator()
19
    {
20
        for ($j = 2; $this->getMaxLimit() >= $j; ++$j) {
21
            if ($this->isPrimeNumber($j)) {
22
                yield $j;
23
            }
24
        }
25
    }
26
}
27