Passed
Pull Request — master (#1136)
by rugk
09:20
created
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/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/Model/Paste.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                 throw new Exception(Controller::GENERIC_ERROR, 63);
45 45
             }
46 46
             // We kindly provide the remaining time before expiration (in seconds)
47
-            $data['meta']['time_to_live'] = $data['meta']['expire_date'] - time();
47
+            $data['meta']['time_to_live'] = $data['meta']['expire_date']-time();
48 48
             unset($data['meta']['expire_date']);
49 49
         }
50 50
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             $expire = $this->_conf->getKey($this->_conf->getKey('default', 'expire'), 'expire_options');
221 221
         }
222 222
         if ($expire > 0) {
223
-            $data['meta']['expire_date'] = time() + $expire;
223
+            $data['meta']['expire_date'] = time()+$expire;
224 224
         }
225 225
         return $data;
226 226
     }
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
@@ -173,8 +173,8 @@
 block discarded – undo
173 173
         $hash = self::getHash('sha256');
174 174
         $now  = time();
175 175
         $tl   = (int) self::$_store->getValue('traffic_limiter', $hash);
176
-        self::$_store->purgeValues('traffic_limiter', $now - self::$_limit);
177
-        if ($tl > 0 && ($tl + self::$_limit >= $now)) {
176
+        self::$_store->purgeValues('traffic_limiter', $now-self::$_limit);
177
+        if ($tl > 0 && ($tl+self::$_limit >= $now)) {
178 178
             $result = false;
179 179
         } else {
180 180
             $tl     = 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
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
         $now  = time();
72 72
         $pl   = (int) self::$_store->getValue('purge_limiter');
73
-        if ($pl + self::$_limit >= $now) {
73
+        if ($pl+self::$_limit >= $now) {
74 74
             return false;
75 75
         }
76 76
         $hasStored = self::$_store->setValue((string) $now, 'purge_limiter');
Please login to merge, or discard this patch.
lib/Data/Database.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
             case 'mssql':
637 637
                 // U: tables created by the user
638 638
                 $sql = 'SELECT "name" FROM "sysobjects" '
639
-                     . 'WHERE "type" = \'U\' ORDER BY "name"';
639
+                        . 'WHERE "type" = \'U\' ORDER BY "name"';
640 640
                 break;
641 641
             case 'mysql':
642 642
                 $sql = 'SHOW TABLES';
@@ -646,22 +646,22 @@  discard block
 block discarded – undo
646 646
                 break;
647 647
             case 'pgsql':
648 648
                 $sql = 'SELECT c."relname" AS "table_name" '
649
-                     . 'FROM "pg_class" c, "pg_user" u '
650
-                     . 'WHERE c."relowner" = u."usesysid" AND c."relkind" = \'r\' '
651
-                     . 'AND NOT EXISTS (SELECT 1 FROM "pg_views" WHERE "viewname" = c."relname") '
652
-                     . "AND c.\"relname\" !~ '^(pg_|sql_)' "
653
-                     . 'UNION '
654
-                     . 'SELECT c."relname" AS "table_name" '
655
-                     . 'FROM "pg_class" c '
656
-                     . "WHERE c.\"relkind\" = 'r' "
657
-                     . 'AND NOT EXISTS (SELECT 1 FROM "pg_views" WHERE "viewname" = c."relname") '
658
-                     . 'AND NOT EXISTS (SELECT 1 FROM "pg_user" WHERE "usesysid" = c."relowner") '
659
-                     . "AND c.\"relname\" !~ '^pg_'";
649
+                        . 'FROM "pg_class" c, "pg_user" u '
650
+                        . 'WHERE c."relowner" = u."usesysid" AND c."relkind" = \'r\' '
651
+                        . 'AND NOT EXISTS (SELECT 1 FROM "pg_views" WHERE "viewname" = c."relname") '
652
+                        . "AND c.\"relname\" !~ '^(pg_|sql_)' "
653
+                        . 'UNION '
654
+                        . 'SELECT c."relname" AS "table_name" '
655
+                        . 'FROM "pg_class" c '
656
+                        . "WHERE c.\"relkind\" = 'r' "
657
+                        . 'AND NOT EXISTS (SELECT 1 FROM "pg_views" WHERE "viewname" = c."relname") '
658
+                        . 'AND NOT EXISTS (SELECT 1 FROM "pg_user" WHERE "usesysid" = c."relowner") '
659
+                        . "AND c.\"relname\" !~ '^pg_'";
660 660
                 break;
661 661
             case 'sqlite':
662 662
                 $sql = 'SELECT "name" FROM "sqlite_master" WHERE "type"=\'table\' '
663
-                     . 'UNION ALL SELECT "name" FROM "sqlite_temp_master" '
664
-                     . 'WHERE "type"=\'table\' ORDER BY "name"';
663
+                        . 'UNION ALL SELECT "name" FROM "sqlite_temp_master" '
664
+                        . 'WHERE "type"=\'table\' ORDER BY "name"';
665 665
                 break;
666 666
             default:
667 667
                 throw new Exception(
Please login to merge, or discard this patch.
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
     {
526 526
         $statement = $this->_db->prepare($sql);
527 527
         foreach ($params as $key => &$parameter) {
528
-            $position = $key + 1;
528
+            $position = $key+1;
529 529
             if (is_int($parameter)) {
530 530
                 $statement->bindParam($position, $parameter, PDO::PARAM_INT);
531 531
             } elseif (is_string($parameter) && strlen($parameter) >= 4000) {
@@ -568,8 +568,7 @@  discard block
 block discarded – undo
568 568
         if ($this->_type === 'oci' && is_array($result)) {
569 569
             // returned CLOB values are streams, convert these into strings
570 570
             $result = $firstOnly ?
571
-                array_map('PrivateBin\Data\Database::_sanitizeClob', $result) :
572
-                $result;
571
+                array_map('PrivateBin\Data\Database::_sanitizeClob', $result) : $result;
573 572
         }
574 573
         return $result;
575 574
     }
Please login to merge, or discard this patch.
lib/Model/Comment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
                         'padding'           => 0,
178 178
                     ),
179 179
                 ));
180
-                $pngdata   = $jdenticon->getImageDataUri('png');
180
+                $pngdata = $jdenticon->getImageDataUri('png');
181 181
             } elseif ($icon == 'vizhash') {
182 182
                 $vh      = new Vizhash16x16();
183 183
                 $pngdata = 'data:image/png;base64,' . base64_encode(
Please login to merge, or discard this patch.
lib/Data/GoogleCloudStorage.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@
 block discarded – undo
65 65
         }
66 66
 
67 67
         $this->_client = class_exists('StorageClientStub', false) ?
68
-            new \StorageClientStub(array()) :
69
-            new StorageClient(array('suppressKeyFileNotice' => true));
68
+            new \StorageClientStub(array()) : new StorageClient(array('suppressKeyFileNotice' => true));
70 69
         if (isset($bucket)) {
71 70
             $this->_bucket = $this->_client->bucket($bucket);
72 71
         }
Please login to merge, or discard this patch.
lib/Request.php 1 patch
Spacing   +3 added lines, -7 removed lines patch added patch discarded remove patch
@@ -107,10 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         // parse parameters, depending on request type
109 109
         switch (array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'GET') {
110
-            case 'DELETE':
111
-            case 'PUT':
112
-            case 'POST':
113
-                // it might be a creation or a deletion, the latter is detected below
110
+            case 'DELETE' : case 'PUT' : case 'POST' : // it might be a creation or a deletion, the latter is detected below
114 111
                 $this->_operation = 'create';
115 112
                 try {
116 113
                     $this->_params = Json::decode(
@@ -183,7 +180,7 @@  discard block
 block discarded – undo
183 180
             $data[$key] = $this->getParam($key, $key == 'v' ? 1 : '');
184 181
         }
185 182
         // forcing a cast to int or float
186
-        $data['v'] = $data['v'] + 0;
183
+        $data['v'] = $data['v']+0;
187 184
         return $data;
188 185
     }
189 186
 
@@ -210,8 +207,7 @@  discard block
 block discarded – undo
210 207
     public function getHost()
211 208
     {
212 209
         return array_key_exists('HTTP_HOST', $_SERVER) ?
213
-            htmlspecialchars($_SERVER['HTTP_HOST']) :
214
-            'localhost';
210
+            htmlspecialchars($_SERVER['HTTP_HOST']) : 'localhost';
215 211
     }
216 212
 
217 213
     /**
Please login to merge, or discard this patch.