| 1 | <?php |
||
| 10 | class Combinations extends Combinatorics implements \Iterator { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $c = array(); |
||
|
|
|||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | protected $count = 0; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var int |
||
| 24 | */ |
||
| 25 | protected $pos = 0; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Combinations constructor. |
||
| 29 | * |
||
| 30 | * @param array $dataset |
||
| 31 | * @param null $length |
||
| 32 | */ |
||
| 33 | 6 | public function __construct(array $dataset = array(), $length = NULL) { |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return int |
||
| 40 | */ |
||
| 41 | public function key() { |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | 6 | public function current() { |
|
| 55 | |||
| 56 | /** |
||
| 57 | * |
||
| 58 | */ |
||
| 59 | 6 | public function next() { |
|
| 67 | |||
| 68 | /** |
||
| 69 | * |
||
| 70 | */ |
||
| 71 | 6 | public function rewind() { |
|
| 75 | |||
| 76 | /** |
||
| 77 | * @return bool |
||
| 78 | */ |
||
| 79 | 6 | public function valid() { |
|
| 82 | |||
| 83 | /** |
||
| 84 | * @return bool |
||
| 85 | */ |
||
| 86 | 6 | protected function _next() { |
|
| 101 | |||
| 102 | /** |
||
| 103 | * @return array |
||
| 104 | */ |
||
| 105 | 3 | public function toArray() { |
|
| 112 | |||
| 113 | /** |
||
| 114 | * @return int |
||
| 115 | */ |
||
| 116 | 3 | public function count() { |
|
| 119 | |||
| 120 | } |
||
| 121 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.