Completed
Push — master ( ed1b88...1e7555 )
by Pol
10:33 queued 04:50
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 6
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
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