Completed
Push — master ( ed1b88...1e7555 )
by Pol
10:33 queued 04:50
created

Shift::generator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace drupol\phpermutations\Generators;
4
5
use drupol\phpermutations\Iterators\Shift as ShiftIterator;
6
7
/**
8
 * Class Shift.
9
 */
10
class Shift extends ShiftIterator
11
{
12
    /**
13
     * Get the generator.
14
     *
15
     * @return \Generator
16
     *                    The generator
17
     */
18
    public function generator()
19
    {
20
        return $this->get();
21
    }
22
23
    /**
24
     * Get the generator.
25
     *
26
     * @codingStandardsIgnoreStart
27
     *
28
     * @return \Generator
29
     *                    The generator
30
     * @codingStandardsIgnoreEnd
31
     */
32
    protected function get()
33
    {
34
        while (true) {
35
            $this->next();
36
            yield $this->current();
37
        }
38
    }
39
}
40