Completed
Push — master ( 9b6b65...1498b8 )
by Pol
02:35
created

FiniteGroup::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 2
eloc 3
nc 2
nop 0
crap 6
1
<?php
2
3
namespace drupol\phpermutations\Generators;
4
5
use drupol\phpermutations\Iterators\FiniteGroup as FiniteGroupIterator;
6
7
/**
8
 * Class FiniteGroup.
9
 *
10
 * The finite group is an abelian finite cyclic group.
11
 *
12
 * @package drupol\phpermutations\Generators
13
 */
14
class FiniteGroup extends FiniteGroupIterator {
15
16
  /**
17
   * Alias of the get() method.
18
   *
19
   * @return \Generator
20
   *   The finite group generator.
21
   */
22
  public function generator() {
23
    return $this->get();
24
  }
25
26
  /**
27
   * The generator.
28
   *
29
   * @codingStandardsIgnoreStart
30
   * @return \Generator
31
   *   The finite group generator.
32
   * @codingStandardsIgnoreEnd
33
   */
34
  protected function get() {
35
    foreach ($this->group as $number) {
36
      yield $number;
37
    }
38
  }
39
40
}
41