Completed
Pull Request — master (#59)
by El
04:11
created
lib/Vizhash16x16.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * constructor
63 63
      *
64 64
      * @access public
65
-     * @return void
65
+     * @return string
66 66
      */
67 67
     public function __construct()
68 68
     {
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
      * @access private
174 174
      * @param  resource $img
175 175
      * @param  string $direction
176
-     * @param  array $color1
177
-     * @param  array $color2
176
+     * @param  integer[] $color1
177
+     * @param  integer[] $color2
178 178
      * @return resource
179 179
      */
180 180
     private function degrade($img, $direction, $color1, $color2)
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
         // We convert the hash into an array of integers.
91 91
         $this->VALUES = array();
92
-        for ($i = 0; $i < $textlen; $i = $i + 2) {
92
+        for ($i = 0; $i < $textlen; $i = $i+2) {
93 93
             array_push($this->VALUES, hexdec(substr($text, $i, 2)));
94 94
         }
95 95
         $this->VALUES_INDEX = 0; // to walk the array.
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         for ($i = 0; $i < 7; ++$i) {
112 112
             $action = $this->getInt();
113 113
             $color = imagecolorallocate($image, $r, $g, $b);
114
-            $r = $r0 = ($r0 + $this->getInt() / 25) % 256;
115
-            $g = $g0 = ($g0 + $this->getInt() / 25) % 256;
116
-            $b = $b0 = ($b0 + $this->getInt() / 25) % 256;
114
+            $r = $r0 = ($r0+$this->getInt() / 25) % 256;
115
+            $g = $g0 = ($g0+$this->getInt() / 25) % 256;
116
+            $b = $b0 = ($b0+$this->getInt() / 25) % 256;
117 117
             $this->drawshape($image, $action, $color);
118 118
         }
119 119
 
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
             $sizeinv = imagesx($img);
188 188
         }
189 189
         $diffs = array(
190
-            (($color2[0] - $color1[0]) / $size),
191
-            (($color2[1] - $color1[1]) / $size),
192
-            (($color2[2] - $color1[2]) / $size)
190
+            (($color2[0]-$color1[0]) / $size),
191
+            (($color2[1]-$color1[1]) / $size),
192
+            (($color2[2]-$color1[2]) / $size)
193 193
         );
194 194
         for ($i = 0; $i < $size; ++$i) {
195
-            $r = $color1[0] + ($diffs[0] * $i);
196
-            $g = $color1[1] + ($diffs[1] * $i);
197
-            $b = $color1[2] + ($diffs[2] * $i);
195
+            $r = $color1[0]+($diffs[0] * $i);
196
+            $g = $color1[1]+($diffs[1] * $i);
197
+            $b = $color1[2]+($diffs[2] * $i);
198 198
             if ($direction == 'h') {
199 199
                 imageline($img, $i, 0, $i, $sizeinv, imagecolorallocate($img, $r, $g, $b));
200 200
             } else {
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
                 ImageFilledPolygon($image, $points, 4, $color);
229 229
                 break;
230 230
             default:
231
-                $start = $this->getInt() * 360 /256;
232
-                $end = $start + $this->getInt() * 180 / 256;
231
+                $start = $this->getInt() * 360 / 256;
232
+                $end = $start+$this->getInt() * 180 / 256;
233 233
                 ImageFilledArc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE);
234 234
         }
235 235
     }
Please login to merge, or discard this patch.
lib/Persistence/TrafficLimiter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,14 +118,14 @@
 block discarded – undo
118 118
 
119 119
         // purge file of expired hashes to keep it small
120 120
         foreach ($tl as $key => $time) {
121
-            if ($time + self::$_limit < $now) {
121
+            if ($time+self::$_limit < $now) {
122 122
                 unset($tl[$key]);
123 123
             }
124 124
         }
125 125
 
126 126
         // this hash is used as an array key, hence a shorter hash is used
127 127
         $hash = self::getHash('sha256');
128
-        if (array_key_exists($hash, $tl) && ($tl[$hash] + self::$_limit >= $now)) {
128
+        if (array_key_exists($hash, $tl) && ($tl[$hash]+self::$_limit >= $now)) {
129 129
             $result = false;
130 130
         } else {
131 131
             $tl[$hash] = time();
Please login to merge, or discard this patch.