Passed
Pull Request — master (#5695)
by
unknown
09:34
created
html/inc/boinc_db.inc 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $user = parse_config($config, '<db_user>');
48 48
         $passwd = parse_config($config, '<db_passwd>');
49 49
         $host = parse_config($config, '<db_host>');
50
-        if ($readonly +0 == 2) {
50
+        if ($readonly + 0 == 2) {
51 51
             $replica_host = parse_config($config, '<replica2_db_host>');
52 52
         } else {
53 53
             $replica_host = parse_config($config, '<replica_db_host>');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 self::$instance = $instance;
70 70
                 return $instance;
71 71
             }
72
-            if ($readonly +0 == 2) {
72
+            if ($readonly + 0 == 2) {
73 73
                 $u = parse_config($config, '<replica2_db_user>');
74 74
                 $p = parse_config($config, '<replica2_db_passwd>');
75 75
                 $n = parse_config($config, '<replica2_db_name>');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 $n = parse_config($config, '<replica_db_name>');
80 80
             }
81 81
             if (($fallback_mode > 0) && (!$u || !$p || !$n)) {
82
-                if ($readonly +0 == 2) {
82
+                if ($readonly + 0 == 2) {
83 83
                     error_log("BoincDb::get_aux(): <replica2_db_*> required for \$fallback_mode > 0 (giving up)");
84 84
                 } else {
85 85
                     error_log("BoincDb::get_aux(): <replica_db_*> required for \$fallback_mode > 0 (giving up)");
@@ -227,11 +227,11 @@  discard block
 block discarded – undo
227 227
         $db = BoincDb::get();
228 228
         return $db->update($this, 'user', $clause);
229 229
     }
230
-    static function enum($where_clause, $order_clause=null) {
230
+    static function enum($where_clause, $order_clause = null) {
231 231
         $db = BoincDb::get();
232 232
         return $db->enum('user', 'BoincUser', $where_clause, $order_clause);
233 233
     }
234
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
234
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
235 235
         $db = BoincDb::get();
236 236
         return $db->enum_fields(
237 237
             'user', 'BoincUser', $fields, $where_clause, $order_clause
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $db = BoincDb::get();
282 282
         return $db->update($this, 'team', $clause);
283 283
     }
284
-    static function enum($where_clause, $order_clause=null) {
284
+    static function enum($where_clause, $order_clause = null) {
285 285
         $db = BoincDb::get();
286 286
         return $db->enum('team', 'BoincTeam', $where_clause, $order_clause);
287 287
     }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
         $db = BoincDb::get();
307 307
         return $db->max('team', $field);
308 308
     }
309
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
309
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
310 310
         $db = BoincDb::get();
311 311
         return $db->enum_fields(
312 312
             'team', 'BoincTeam', $fields, $where_clause, $order_clause
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
         $db = BoincDb::get();
345 345
         return $db->delete($this, 'host');
346 346
     }
347
-    static function enum($where_clause, $order_clause=null) {
347
+    static function enum($where_clause, $order_clause = null) {
348 348
         $db = BoincDb::get();
349 349
         return $db->enum('host', 'BoincHost', $where_clause, $order_clause);
350 350
     }
351
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
351
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
352 352
         $db = BoincDb::get();
353 353
         return $db->enum_fields(
354 354
             'host', 'BoincHost', $fields, $where_clause, $order_clause
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
         $db = BoincDb::get();
471 471
         return $db->update($this, 'app', $clause);
472 472
     }
473
-    static function sum($field, $clause=null) {
473
+    static function sum($field, $clause = null) {
474 474
         $db = BoincDb::get();
475 475
         return $db->sum('app', $field, $clause);
476 476
     }
@@ -528,11 +528,11 @@  discard block
 block discarded – undo
528 528
         $db = BoincDb::get();
529 529
         return $db->insert('profile', $clause);
530 530
     }
531
-    static function enum($where_clause=null, $order_clause=null) {
531
+    static function enum($where_clause = null, $order_clause = null) {
532 532
         $db = BoincDb::get();
533 533
         return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause);
534 534
     }
535
-    static function enum_fields($fields, $where_clause=null, $order_clause=null) {
535
+    static function enum_fields($fields, $where_clause = null, $order_clause = null) {
536 536
         $db = BoincDb::get();
537 537
         return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause);
538 538
     }
@@ -927,12 +927,12 @@  discard block
 block discarded – undo
927 927
         return $db->enum('consent', 'BoincConsent', $where_clause);
928 928
     }
929 929
 
930
-    static function insert ($clause) {
930
+    static function insert($clause) {
931 931
         $db = BoincDb::get();
932 932
         return $db->insert('consent', $clause);
933 933
     }
934 934
 
935
-    static function update ($clause) {
935
+    static function update($clause) {
936 936
         $db = BoincDb::get();
937 937
         return $db->update_aux('consent', $clause);
938 938
     }
@@ -957,17 +957,17 @@  discard block
 block discarded – undo
957 957
         return $db->lookup('consent_type', 'BoincConsentType', $clause);
958 958
     }
959 959
 
960
-    static function enum($where_clause, $order_clause=null) {
960
+    static function enum($where_clause, $order_clause = null) {
961 961
         $db = BoincDb::get();
962 962
         return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause);
963 963
     }
964 964
 
965
-    static function insert ($clause) {
965
+    static function insert($clause) {
966 966
         $db = BoincDb::get();
967 967
         return $db->insert('consent_type', $clause);
968 968
     }
969 969
 
970
-    static function update ($clause) {
970
+    static function update($clause) {
971 971
         $db = BoincDb::get();
972 972
         return $db->update_aux('consent_type', $clause);
973 973
     }
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
         return $db->lookup('latest_consent', 'BoincLatestConsent', $clause);
994 994
     }
995 995
 
996
-    static function enum($where_clause, $order_clause=null) {
996
+    static function enum($where_clause, $order_clause = null) {
997 997
         $db = BoincDb::get();
998 998
         return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause);
999 999
     }
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 // apply this to any user-supplied strings used in queries
1005 1005
 //
1006 1006
 function boinc_real_escape_string($x) {
1007
-    if (version_compare(phpversion(),"4.3.0")>=0) {
1007
+    if (version_compare(phpversion(), "4.3.0") >= 0) {
1008 1008
         return BoincDb::escape_string($x);
1009 1009
     } else {
1010 1010
         $x = str_replace("'", "\'", $x);
Please login to merge, or discard this patch.