@@ -39,8 +39,9 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function current() { |
| 41 | 41 | $r = array(); |
| 42 | - for($i = 0; $i < $this->length; $i++) |
|
| 43 | - $r[] = $this->dataset[$this->c[$i]]; |
|
| 42 | + for($i = 0; $i < $this->length; $i++) { |
|
| 43 | + $r[] = $this->dataset[$this->c[$i]]; |
|
| 44 | + } |
|
| 44 | 45 | return $r; |
| 45 | 46 | } |
| 46 | 47 | |
@@ -48,10 +49,11 @@ discard block |
||
| 48 | 49 | * |
| 49 | 50 | */ |
| 50 | 51 | public function next() { |
| 51 | - if ($this->_next()) |
|
| 52 | - $this->pos++; |
|
| 53 | - else |
|
| 54 | - $this->pos = -1; |
|
| 52 | + if ($this->_next()) { |
|
| 53 | + $this->pos++; |
|
| 54 | + } else { |
|
| 55 | + $this->pos = -1; |
|
| 56 | + } |
|
| 55 | 57 | } |
| 56 | 58 | |
| 57 | 59 | /** |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | foreach (new Combinations($items, $this->getLength()) as $dataset) { |
| 92 | 92 | if (empty($dataset)) { |
| 93 | 93 | $return = array($perms); |
| 94 | - } else { |
|
| 94 | + } else { |
|
| 95 | 95 | $return = array(); |
| 96 | 96 | for ($i = count($dataset) - 1; $i >= 0; --$i) { |
| 97 | 97 | $newitems = $dataset; |