Passed
Push — master ( 90e83d...4a3542 )
by El
03:14
created
lib/Data/Database.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                 break;
488 488
             case 'mssql':
489 489
                 $sql = 'SELECT name FROM sysobjects '
490
-                     . "WHERE type = 'U' ORDER BY name";
490
+                        . "WHERE type = 'U' ORDER BY name";
491 491
                 break;
492 492
             case 'mysql':
493 493
                 $sql = 'SHOW TABLES';
@@ -497,22 +497,22 @@  discard block
 block discarded – undo
497 497
                 break;
498 498
             case 'pgsql':
499 499
                 $sql = 'SELECT c.relname AS table_name '
500
-                     . 'FROM pg_class c, pg_user u '
501
-                     . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' "
502
-                     . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
503
-                     . "AND c.relname !~ '^(pg_|sql_)' "
504
-                     . 'UNION '
505
-                     . 'SELECT c.relname AS table_name '
506
-                     . 'FROM pg_class c '
507
-                     . "WHERE c.relkind = 'r' "
508
-                     . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
509
-                     . 'AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) '
510
-                     . "AND c.relname !~ '^pg_'";
500
+                        . 'FROM pg_class c, pg_user u '
501
+                        . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' "
502
+                        . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
503
+                        . "AND c.relname !~ '^(pg_|sql_)' "
504
+                        . 'UNION '
505
+                        . 'SELECT c.relname AS table_name '
506
+                        . 'FROM pg_class c '
507
+                        . "WHERE c.relkind = 'r' "
508
+                        . 'AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) '
509
+                        . 'AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) '
510
+                        . "AND c.relname !~ '^pg_'";
511 511
                 break;
512 512
             case 'sqlite':
513 513
                 $sql = "SELECT name FROM sqlite_master WHERE type='table' "
514
-                     . 'UNION ALL SELECT name FROM sqlite_temp_master '
515
-                     . "WHERE type='table' ORDER BY name";
514
+                        . 'UNION ALL SELECT name FROM sqlite_temp_master '
515
+                        . "WHERE type='table' ORDER BY name";
516 516
                 break;
517 517
             default:
518 518
                 throw new Exception(
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         }
169 169
 
170 170
         $opendiscussion = $burnafterreading = false;
171
-        $attachment     = $attachmentname     = '';
171
+        $attachment     = $attachmentname = '';
172 172
         $meta           = $paste['meta'];
173 173
         unset($meta['postdate']);
174 174
         $expire_date = 0;
@@ -461,8 +461,7 @@  discard block
 block discarded – undo
461 461
         $statement = self::$_db->prepare($sql);
462 462
         $statement->execute($params);
463 463
         $result = $firstOnly ?
464
-            $statement->fetch(PDO::FETCH_ASSOC) :
465
-            $statement->fetchAll(PDO::FETCH_ASSOC);
464
+            $statement->fetch(PDO::FETCH_ASSOC) : $statement->fetchAll(PDO::FETCH_ASSOC);
466 465
         $statement->closeCursor();
467 466
         return $result;
468 467
     }
Please login to merge, or discard this patch.
lib/I18n.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
         if (is_array(self::$_translations[$messageId])) {
116 116
             $number = (int) $args[1];
117 117
             $key    = self::_getPluralForm($number);
118
-            $max    = count(self::$_translations[$messageId]) - 1;
118
+            $max    = count(self::$_translations[$messageId])-1;
119 119
             if ($key > $max) {
120 120
                 $key = $max;
121 121
             }
Please login to merge, or discard this patch.
lib/Vizhash16x16.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         // We convert the hash into an array of integers.
89 89
         $this->VALUES = array();
90
-        for ($i = 0; $i < $textlen; $i = $i + 2) {
90
+        for ($i = 0; $i < $textlen; $i = $i+2) {
91 91
             array_push($this->VALUES, hexdec(substr($text, $i, 2)));
92 92
         }
93 93
         $this->VALUES_INDEX = 0; // to walk the array.
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
         for ($i = 0; $i < 7; ++$i) {
110 110
             $action = $this->getInt();
111 111
             $color  = imagecolorallocate($image, $r, $g, $b);
112
-            $r      = $r0      = ($r0 + $this->getInt() / 25) % 256;
113
-            $g      = $g0      = ($g0 + $this->getInt() / 25) % 256;
114
-            $b      = $b0      = ($b0 + $this->getInt() / 25) % 256;
112
+            $r      = $r0      = ($r0+$this->getInt() / 25) % 256;
113
+            $g      = $g0      = ($g0+$this->getInt() / 25) % 256;
114
+            $b      = $b0      = ($b0+$this->getInt() / 25) % 256;
115 115
             $this->drawshape($image, $action, $color);
116 116
         }
117 117
 
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
             $sizeinv = imagesx($img);
186 186
         }
187 187
         $diffs = array(
188
-            (($color2[0] - $color1[0]) / $size),
189
-            (($color2[1] - $color1[1]) / $size),
190
-            (($color2[2] - $color1[2]) / $size),
188
+            (($color2[0]-$color1[0]) / $size),
189
+            (($color2[1]-$color1[1]) / $size),
190
+            (($color2[2]-$color1[2]) / $size),
191 191
         );
192 192
         for ($i = 0; $i < $size; ++$i) {
193
-            $r = $color1[0] + ($diffs[0] * $i);
194
-            $g = $color1[1] + ($diffs[1] * $i);
195
-            $b = $color1[2] + ($diffs[2] * $i);
193
+            $r = $color1[0]+($diffs[0] * $i);
194
+            $g = $color1[1]+($diffs[1] * $i);
195
+            $b = $color1[2]+($diffs[2] * $i);
196 196
             if ($direction == 'h') {
197 197
                 imageline($img, $i, 0, $i, $sizeinv, imagecolorallocate($img, $r, $g, $b));
198 198
             } else {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 break;
228 228
             default:
229 229
                 $start = $this->getInt() * 360 / 256;
230
-                $end   = $start + $this->getInt() * 180 / 256;
230
+                $end   = $start+$this->getInt() * 180 / 256;
231 231
                 imagefilledarc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE);
232 232
         }
233 233
     }
Please login to merge, or discard this patch.
lib/Configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
             // "*_options" sections don't require all defaults to be set
138 138
             if (
139 139
                 $section !== 'model_options' &&
140
-                ($from = strlen($section) - strlen($opts)) >= 0 &&
140
+                ($from = strlen($section)-strlen($opts)) >= 0 &&
141 141
                 strpos($section, $opts, $from) !== false
142 142
             ) {
143 143
                 if (is_int(current($values))) {
Please login to merge, or discard this patch.
lib/Request.php 1 patch
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -92,9 +92,7 @@
 block discarded – undo
92 92
 
93 93
         // parse parameters, depending on request type
94 94
         switch (array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'GET') {
95
-            case 'DELETE':
96
-            case 'PUT':
97
-                parse_str(file_get_contents(self::$_inputStream), $this->_params);
95
+            case 'DELETE' : case 'PUT' : parse_str(file_get_contents(self::$_inputStream), $this->_params);
98 96
                 break;
99 97
             case 'POST':
100 98
                 $this->_params = $_POST;
Please login to merge, or discard this patch.
lib/Data/Filesystem.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -270,10 +270,9 @@
 block discarded – undo
270 270
                 }
271 271
                 $thirdLevel = array_filter(
272 272
                     array_map(
273
-                        function ($filename) {
273
+                        function($filename) {
274 274
                             return strlen($filename) >= 20 ?
275
-                                substr($filename, 0, -4) :
276
-                                $filename;
275
+                                substr($filename, 0, -4) : $filename;
277 276
                         },
278 277
                         scandir($path)
279 278
                     ),
Please login to merge, or discard this patch.
lib/Model/Paste.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 throw new Exception(Controller::GENERIC_ERROR, 63);
46 46
             }
47 47
             // We kindly provide the remaining time before expiration (in seconds)
48
-            $data->meta->remaining_time = $data->meta->expire_date - time();
48
+            $data->meta->remaining_time = $data->meta->expire_date-time();
49 49
         }
50 50
 
51 51
         // check if non-expired burn after reading paste needs to be deleted
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $expire = $this->_conf->getKey($this->_conf->getKey('default', 'expire'), 'expire_options');
233 233
         }
234 234
         if ($expire > 0) {
235
-            $this->_data->meta->expire_date = time() + $expire;
235
+            $this->_data->meta->expire_date = time()+$expire;
236 236
         }
237 237
     }
238 238
 
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
@@ -111,14 +111,14 @@
 block discarded – undo
111 111
         // purge file of expired hashes to keep it small
112 112
         $now = time();
113 113
         foreach ($tl as $key => $time) {
114
-            if ($time + self::$_limit < $now) {
114
+            if ($time+self::$_limit < $now) {
115 115
                 unset($tl[$key]);
116 116
             }
117 117
         }
118 118
 
119 119
         // this hash is used as an array key, hence a shorter algo is used
120 120
         $hash = self::getHash('sha256');
121
-        if (array_key_exists($hash, $tl) && ($tl[$hash] + self::$_limit >= $now)) {
121
+        if (array_key_exists($hash, $tl) && ($tl[$hash]+self::$_limit >= $now)) {
122 122
             $result = false;
123 123
         } else {
124 124
             $tl[$hash] = time();
Please login to merge, or discard this patch.
lib/Persistence/PurgeLimiter.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
         if (self::_exists($file)) {
76 76
             require self::getPath($file);
77 77
             $pl = $GLOBALS['purge_limiter'];
78
-            if ($pl + self::$_limit >= $now) {
78
+            if ($pl+self::$_limit >= $now) {
79 79
                 return false;
80 80
             }
81 81
         }
Please login to merge, or discard this patch.