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

Shift   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
cbo 1
dl 0
loc 30
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generator() 0 4 1
A get() 0 7 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