Completed
Push — master ( d0bddc...9b6b65 )
by Pol
02:20
created

ZGroup   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
cbo 1
dl 0
loc 27
ccs 0
cts 7
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generator() 0 3 1
A get() 0 5 2
1
<?php
2
3
namespace drupol\phpermutations\Generators;
4
5
use drupol\phpermutations\Iterators\ZGroup as ZGroupIterator;
6
7
/**
8
 * Class ZGroup.
9
 *
10
 * Z is an abelian finite cyclic group.
11
 *
12
 * @package drupol\phpermutations\Generators
13
 */
14
class ZGroup extends ZGroupIterator {
15
16
  /**
17
   * Alias of the get() method.
18
   *
19
   * @return \Generator
20
   *   The prime factors generator.
21
   */
22
  public function generator() {
23
    return $this->get();
24
  }
25
26
  /**
27
   * The generator.
28
   *
29
   * @codingStandardsIgnoreStart
30
   * @return \Generator
31
   *   The prime factors generator.
32
   * @codingStandardsIgnoreEnd
33
   */
34
  protected function get() {
35
    foreach ($this->group as $number) {
36
      yield $number;
37
    }
38
  }
39
40
}
41