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

Shift::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
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\Shift as ShiftIterator;
9
10
/**
11
 * Class Shift.
12
 */
13
class Shift extends ShiftIterator implements GeneratorInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function generator()
19
    {
20
        while (true) {
21
            $this->next();
22
23
            yield $this->current();
24
        }
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function toArray()
31
    {
32
        return [];
33
    }
34
}
35