Completed
Push — master ( 15a3ff...ddeb31 )
by Pol
02:16
created
src/Combinations.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
    */
48 48
   public function current() {
49 49
     $r = array();
50
-    for($i = 0; $i < $this->length; $i++) {
50
+    for ($i = 0; $i < $this->length; $i++) {
51 51
       $r[] = $this->dataset[$this->c[$i]];
52 52
     }
53 53
     return $r;
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
     while ($i >= 0 && $this->c[$i] == $this->datasetCount - $this->length + $i) {
89 89
       $i--;
90 90
     }
91
-    if($i < 0) {
91
+    if ($i < 0) {
92 92
       return FALSE;
93 93
     }
94 94
     $this->c[$i]++;
95
-    while($i++ < $this->length - 1) {
95
+    while ($i++ < $this->length - 1) {
96 96
       $this->c[$i] = $this->c[$i - 1] + 1;
97 97
     }
98 98
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
    */
105 105
   public function toArray() {
106 106
     $data = [];
107
-    for($this->rewind(); $this->valid(); $this->next()) {
107
+    for ($this->rewind(); $this->valid(); $this->next()) {
108 108
       $data[] = $this->current();
109 109
     }
110 110
     return $data;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
    * @return int
115 115
    */
116 116
   public function count() {
117
-    return $this->fact(count($this->getDataset()))/$this->fact($this->getLength());
117
+    return $this->fact(count($this->getDataset())) / $this->fact($this->getLength());
118 118
   }
119 119
 
120 120
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
59 59
   public function next() {
60 60
     if ($this->_next()) {
61 61
       $this->pos++;
62
-    }
63
-    else {
62
+    } else {
64 63
       $this->pos = -1;
65 64
     }
66 65
   }
Please login to merge, or discard this patch.
src/Combinatorics.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
    * @return int
76 76
    */
77 77
   protected function fact($n, $total = 1) {
78
-      return ($n < 2) ? $total : $this->fact($n-1, $total * $n);
78
+      return ($n < 2) ? $total : $this->fact($n - 1, $total * $n);
79 79
   }
80 80
 
81 81
 }
82 82
\ No newline at end of file
Please login to merge, or discard this patch.
src/Permutations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
    */
61 61
   protected function permute($p, $size) {
62 62
     // slide down the array looking for where we're smaller than the next guy
63
-    for ($i = $size - 1; $i >= 0 && $p[$i] >= $p[$i+1]; --$i) { }
63
+    for ($i = $size - 1; $i >= 0 && $p[$i] >= $p[$i + 1]; --$i) { }
64 64
 
65 65
     // if this doesn't occur, we've finished our permutations
66 66
     // the array is reversed: (1, 2, 3, 4) => (4, 3, 2, 1)
Please login to merge, or discard this patch.
src/Product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
   public function toArray() {
123 123
     $data = array();
124 124
 
125
-    for($this->rewind(); $this->valid(); $this->next()) {
125
+    for ($this->rewind(); $this->valid(); $this->next()) {
126 126
       $data[] = $this->current();
127 127
     }
128 128
 
Please login to merge, or discard this patch.