Passed
Push — client_release/8/8.2 ( 523f15...fbad58 )
by Vitalii
09:04
created
html/project.sample/project.inc 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 //define("STYLESHEET", "aaa.css");
46 46
 //define("STYLESHEET2", "bbb.css");
47 47
 //define("SHORTCUT_ICON", "f.gif");     // browser tab icon
48
-define('DARK_MODE', true);      // enable dark mode if selected by user
48
+define('DARK_MODE', true); // enable dark mode if selected by user
49 49
 
50 50
 //-------------- enable/disable web features
51 51
 
52 52
 define('UNIQUE_USER_NAME', true);
53 53
 define("FORUM_QA_MERGED_MODE", true);
54 54
     // Set to true to merge Message boards and Q&A section
55
-define ("DISABLE_PROFILES", true);
55
+define("DISABLE_PROFILES", true);
56 56
     // enable profiles only after enabling reCAPTCHA
57 57
     // https://github.com/BOINC/boinc/wiki/ProtectionFromSpam
58 58
 define("USE_STOPFORUMSPAM", true);
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
     </ol>", PROJECT);
194 194
 }
195 195
 
196
-function project_workunit($wu){
196
+function project_workunit($wu) {
197 197
     // shown in the workunit page
198 198
 }
199 199
 
200
-function project_user_summary($user){
200
+function project_user_summary($user) {
201 201
     // shown in the user summary page
202 202
 }
203 203
 
204
-function project_user_page_private($user){
204
+function project_user_page_private($user) {
205 205
     // shown in the private account page
206 206
 }
207 207
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
     array("name" => "Uppercase", "short_name" => "UC", "appids" => array(1, 25)),
285 285
 );
286 286
 
287
-function project_user_credit($user){
287
+function project_user_credit($user) {
288 288
     global $sub_projects;
289 289
     foreach ($sub_projects as $sp) {
290 290
         show_app_credit_user($user, $sp["name"], $sp["appids"]);
Please login to merge, or discard this patch.
html/inc/result.inc 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     return $platforms[$id];
54 54
 }
55 55
 
56
-function anon_platform_string($result, $rsc_name=null) {
56
+function anon_platform_string($result, $rsc_name = null) {
57 57
     $app = get_app($result->appid);
58
-    $n = $app->user_friendly_name."<br>".  tra("Anonymous platform");
58
+    $n = $app->user_friendly_name."<br>".tra("Anonymous platform");
59 59
     if ($rsc_name) {
60 60
         $n .= " ($rsc_name)";
61 61
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         return $string_to_show;
103 103
     }
104 104
     if ($result->server_state <> RESULT_SERVER_STATE_OVER) return "---";
105
-    switch($result->outcome) {
105
+    switch ($result->outcome) {
106 106
     case RESULT_OUTCOME_SUCCESS:
107 107
         switch ($result->validate_state) {
108 108
         case VALIDATE_STATE_INIT:
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             ) {
241 241
                 return tra("Not started by deadline - canceled");
242 242
             }
243
-            switch($result->client_state) {
243
+            switch ($result->client_state) {
244 244
             case RESULT_FILES_DOWNLOADING: return tra("Error while downloading");
245 245
             case RESULT_FILES_DOWNLOADED:
246 246
             case RESULT_COMPUTE_ERROR: return tra("Error while computing");
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 }
260 260
 
261 261
 function result_server_state_string($result) {
262
-    switch($result->server_state) {
262
+    switch ($result->server_state) {
263 263
     case RESULT_SERVER_STATE_INACTIVE: return tra("Inactive");
264 264
     case RESULT_SERVER_STATE_UNSENT: return tra("Unsent");
265 265
     case RESULT_SERVER_STATE_IN_PROGRESS: return tra("In progress");
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 }
270 270
 
271 271
 function result_outcome_string($result) {
272
-    switch($result->outcome) {
272
+    switch ($result->outcome) {
273 273
     case RESULT_OUTCOME_INIT: return "---";
274 274
     case RESULT_OUTCOME_SUCCESS: return tra("Success");
275 275
     case RESULT_OUTCOME_COULDNT_SEND: return tra("Couldn't send");
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 }
288 288
 
289 289
 function result_client_state_string($result) {
290
-    switch($result->client_state) {
290
+    switch ($result->client_state) {
291 291
     case RESULT_NEW: return tra("New");
292 292
     case RESULT_FILES_DOWNLOADING: return tra("Downloading");
293 293
     case RESULT_FILES_DOWNLOADED: return tra("Processing");
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 }
306 306
 
307 307
 function validate_state_str($result) {
308
-    switch($result->validate_state) {
308
+    switch ($result->validate_state) {
309 309
     case VALIDATE_STATE_INIT: return tra("Initial");
310 310
     case VALIDATE_STATE_VALID: return tra("Valid");
311 311
     case VALIDATE_STATE_INVALID:
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 }
322 322
 
323 323
 function assimilate_state_str($s) {
324
-    switch($s) {
324
+    switch ($s) {
325 325
     case ASSIMILATE_INIT: return "Initial";
326 326
     case ASSIMILATE_READY: return "Ready to assimilate";
327 327
     case ASSIMILATE_DONE: return "Assimilated";
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 }
331 331
 
332 332
 function file_delete_state_str($s) {
333
-    switch($s) {
333
+    switch ($s) {
334 334
     case FILE_DELETE_INIT: return "Initial";
335 335
     case FILE_DELETE_READY: return "Ready to delete";
336 336
     case FILE_DELETE_DONE: return "Deleted";
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 // convert WU error bitmask to str.
343 343
 // If $color, add HTML red color
344 344
 //
345
-function wu_error_mask_str($s, $color=false) {
345
+function wu_error_mask_str($s, $color = false) {
346 346
     $x = "";
347 347
     if ($s & WU_ERROR_COULDNT_SEND_RESULT) {
348 348
         $x = $x." ".tra("Couldn't send result");
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
     if ($result->received_time) {
457 457
         $r = time_str($result->received_time);
458 458
     } else if ($result->report_deadline) {
459
-        if ($result->report_deadline>time()) {
460
-            $r = "<font color='#33cc33'>" . time_str($result->report_deadline) . "</font>";
459
+        if ($result->report_deadline > time()) {
460
+            $r = "<font color='#33cc33'>".time_str($result->report_deadline)."</font>";
461 461
         } else {
462
-            $r = "<font color='#ff3333'>" . time_str($result->report_deadline) . "</font>";
462
+            $r = "<font color='#ff3333'>".time_str($result->report_deadline)."</font>";
463 463
         }
464 464
     } else {
465 465
         $r = "---";
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 // @param Integer $dec A signed integer
521 521
 //
522 522
 function int2hex($dec) {
523
-    return "0x".strtoupper(substr(sprintf("%08x",$dec), -8));
523
+    return "0x".strtoupper(substr(sprintf("%08x", $dec), -8));
524 524
 }
525 525
 
526 526
 // Decode a windows error number into semi-human-readable,
@@ -530,9 +530,9 @@  discard block
 block discarded – undo
530 530
 // @return String A human readable error message
531 531
 // @param Integer $x An error number
532 532
 //
533
-function windows_error_code_str($x){
534
-    $h=int2hex($x);
535
-    switch($h){
533
+function windows_error_code_str($x) {
534
+    $h = int2hex($x);
535
+    switch ($h) {
536 536
     case "0xC0000005": return "STATUS_ACCESS_VIOLATION";
537 537
     case "0xC000001D": return "STATUS_ILLEGAL_INSTRUCTION";
538 538
     case "0xC0000094": return "STATUS_INTEGER_DIVIDE_BY_ZERO";
@@ -553,10 +553,10 @@  discard block
 block discarded – undo
553 553
 // @return String A human readable error message
554 554
 // @param Integer $x An error number
555 555
 //
556
-function error_code_str($x){
556
+function error_code_str($x) {
557 557
     // severe Windows error numbers are always large negative integers
558
-    if ($x<-400) return windows_error_code_str($x);
559
-    switch($x){
558
+    if ($x < -400) return windows_error_code_str($x);
559
+    switch ($x) {
560 560
     case 0: return "";
561 561
     case 192: return "EXIT_STATEFILE_WRITE";
562 562
     case 193: return "EXIT_SIGNAL";
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
     return $x." (".int2hex($x).") ".error_code_str($x);
718 718
 }
719 719
 
720
-function show_result($result, $show_outfile_links=false) {
720
+function show_result($result, $show_outfile_links = false) {
721 721
     start_table();
722 722
     row2(tra("Name"), $result->name);
723 723
     row2(tra("Workunit"), "<a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a>");
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         echo "<h3>".tra("Stderr output")."</h3> <pre>"
770 770
             .htmlspecialchars(
771 771
                 $result->stderr_out,
772
-                ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0),
772
+                ENT_QUOTES|(defined('ENT_SUBSTITUTE') ?ENT_SUBSTITUTE:0),
773 773
                 'utf-8'
774 774
             )
775 775
             ."</pre>"
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
     $apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name');
787 787
 
788
-    for ($i=0; $i<NSTATES; $i++) {
788
+    for ($i = 0; $i < NSTATES; $i++) {
789 789
         $state_count[$i] = 0;
790 790
     }
791 791
     foreach ($apps as $app) {
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
         $x .= "<a href=$url>".tra("Next")." ".$info->results_per_page."</a>";
829 829
     }
830 830
     $x .= "<br>".tra("State").": ";
831
-    for ($i=0; $i<NSTATES; $i++) {
831
+    for ($i = 0; $i < NSTATES; $i++) {
832 832
         if ($i) $x .= " &middot; ";
833 833
         if ($info->state == $i) {
834 834
             $x .= $state_name[$i];
Please login to merge, or discard this patch.
html/user/show_apps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             $desc->long_name,
38 38
             $desc->description,
39 39
             kw_array_to_str($desc->sci_kw),
40
-            empty($desc->url)?'':"<a href=$desc->url>View</a>",
40
+            empty($desc->url) ? '' : "<a href=$desc->url>View</a>",
41 41
             'Yes'
42 42
         );
43 43
     }
Please login to merge, or discard this patch.
html/inc/keywords.inc 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -24,72 +24,72 @@  discard block
 block discarded – undo
24 24
 define('KW_CATEGORY_SCIENCE', 0);
25 25
 define('KW_CATEGORY_LOC', 1);
26 26
 
27
-define('KW_ASTRONOMY',      1);
28
-define('KW_SETI',           2);
29
-define('KW_PULSARS',        3);
30
-define('KW_GW',             4);
31
-define('KW_COSMOLOGY',      5);
32
-define('KW_PHYSICS',        6);
27
+define('KW_ASTRONOMY', 1);
28
+define('KW_SETI', 2);
29
+define('KW_PULSARS', 3);
30
+define('KW_GW', 4);
31
+define('KW_COSMOLOGY', 5);
32
+define('KW_PHYSICS', 6);
33 33
 define('KW_PARTICLE_PHYSICS', 7);
34
-define('KW_NANOSCIENCE',    8);
35
-define('KW_BIOMED',         9);
34
+define('KW_NANOSCIENCE', 8);
35
+define('KW_BIOMED', 9);
36 36
 define('KW_DRUG_DISCOVERY', 10);
37
-define('KW_PROTEINS',       11);
38
-define('KW_GENETICS',       12);
39
-define('KW_DISEASE',        13);
40
-define('KW_CANCER',         14);
41
-define('KW_MATH_CS',        15);
42
-define('KW_AI',             16);
43
-define('KW_OCEANIA',        17);
44
-define('KW_AUSTRALIA',      18);
37
+define('KW_PROTEINS', 11);
38
+define('KW_GENETICS', 12);
39
+define('KW_DISEASE', 13);
40
+define('KW_CANCER', 14);
41
+define('KW_MATH_CS', 15);
42
+define('KW_AI', 16);
43
+define('KW_OCEANIA', 17);
44
+define('KW_AUSTRALIA', 18);
45 45
 
46
-define('KW_EUROPE',         20);
47
-define('KW_GERMANY',        21);
48
-define('KW_ASIA',           22);
49
-define('KW_AMERICAS',       23);
50
-define('KW_US',             24);
51
-define('KW_UCB',            25);
52
-define('KW_AEI',            26);
53
-define('KW_CERN',           27);
54
-define('KW_UW',             28);
55
-define('KW_EARTH_SCI',      29);
56
-define('KW_SPAIN',          30);
57
-define('KW_SAN_JORGE',      31);
58
-define('KW_NUMBER_THEORY',  32);
59
-define('KW_CRYPTO',         33);
60
-define('KW_ENV_RESEARCH',   34);
61
-define('KW_CLIMATE',        35);
62
-define('KW_CZECH',          36);
46
+define('KW_EUROPE', 20);
47
+define('KW_GERMANY', 21);
48
+define('KW_ASIA', 22);
49
+define('KW_AMERICAS', 23);
50
+define('KW_US', 24);
51
+define('KW_UCB', 25);
52
+define('KW_AEI', 26);
53
+define('KW_CERN', 27);
54
+define('KW_UW', 28);
55
+define('KW_EARTH_SCI', 29);
56
+define('KW_SPAIN', 30);
57
+define('KW_SAN_JORGE', 31);
58
+define('KW_NUMBER_THEORY', 32);
59
+define('KW_CRYPTO', 33);
60
+define('KW_ENV_RESEARCH', 34);
61
+define('KW_CLIMATE', 35);
62
+define('KW_CZECH', 36);
63 63
 define('KW_CHARLES_PRAGUE', 37);
64
-define('KW_RECHENKRAFT',    38);
65
-define('KW_RHEINMAIN',      39);
66
-define('KW_HUNGARY',        40);
67
-define('KW_IRELAND',        41);
68
-define('KW_UC_DUBLIN',      42);
69
-define('KW_POLAND',         43);
70
-define('KW_RUSSIA',         44);
64
+define('KW_RECHENKRAFT', 38);
65
+define('KW_RHEINMAIN', 39);
66
+define('KW_HUNGARY', 40);
67
+define('KW_IRELAND', 41);
68
+define('KW_UC_DUBLIN', 42);
69
+define('KW_POLAND', 43);
70
+define('KW_RUSSIA', 44);
71 71
 define('KW_SW_STATE_RUSSIA', 45);
72
-define('KW_RAS',            46);
73
-define('KW_PRBB',           47);
74
-define('KW_UK',             48);
75
-define('KW_OXFORD',         49);
76
-define('KW_CHINA',          50);
77
-define('KW_U_DAYTON',       51);
78
-define('KW_WRIGHT_STATE',   52);
79
-define('KW_USC',            53);
80
-define('KW_FULLERTON',      54);
81
-define('KW_ARIZONA_STATE',  55);
82
-define('KW_U_ILLINOIS',     56);
83
-define('KW_U_WARSAW',       57);
84
-define('KW_RPI',            58);
85
-define('KW_INTERNATIONAL',  59);
86
-define('KW_UND',            60);
87
-define('KW_HOLLAND',        61);
88
-define('KW_CHEMISTRY',      62);
89
-define('KW_GAMES',          63);
90
-define('KW_VIRUS',          64);
91
-define('KW_FRANCE',         65);
92
-define('KW_CANADA',         66);
72
+define('KW_RAS', 46);
73
+define('KW_PRBB', 47);
74
+define('KW_UK', 48);
75
+define('KW_OXFORD', 49);
76
+define('KW_CHINA', 50);
77
+define('KW_U_DAYTON', 51);
78
+define('KW_WRIGHT_STATE', 52);
79
+define('KW_USC', 53);
80
+define('KW_FULLERTON', 54);
81
+define('KW_ARIZONA_STATE', 55);
82
+define('KW_U_ILLINOIS', 56);
83
+define('KW_U_WARSAW', 57);
84
+define('KW_RPI', 58);
85
+define('KW_INTERNATIONAL', 59);
86
+define('KW_UND', 60);
87
+define('KW_HOLLAND', 61);
88
+define('KW_CHEMISTRY', 62);
89
+define('KW_GAMES', 63);
90
+define('KW_VIRUS', 64);
91
+define('KW_FRANCE', 65);
92
+define('KW_CANADA', 66);
93 93
 
94 94
 $job_keywords = array();
95 95
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
     }
331 331
 }
332 332
 
333
-function kw_options($id, $indent='') {
333
+function kw_options($id, $indent = '') {
334 334
     global $job_keywords;
335 335
     $kw = $job_keywords[$id];
336 336
     $opts = [[$id, "$indent$kw->name"]];
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
     return $kw->name;
348 348
 }
349 349
 
350
-function kw_array_to_str($kws, $sep='<br>') {
350
+function kw_array_to_str($kws, $sep = '<br>') {
351 351
     $x = array_map('strval', $kws);
352 352
     $x = array_map('kw_id_to_name', $x);
353 353
     return implode($sep, $x);
Please login to merge, or discard this patch.
html/inc/boinc_db.inc 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 // close() closes the connection.
45 45
 
46 46
 class BoincDb {
47
-    static $instance;       // a DbConn object, or null
48
-    static $dbnum;          // which replica we're connected to
47
+    static $instance; // a DbConn object, or null
48
+    static $dbnum; // which replica we're connected to
49 49
 
50 50
     // connect to DB $dbnum (0, 1, ...)
51 51
     // If the requested DB doesn't exist or connection fails, connect to DB 0.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         self::$instance = null;
57 57
         $config = get_config();
58 58
         if ($dbnum) {
59
-            $r = $dbnum==1?'':strval($dbnum);
59
+            $r = $dbnum == 1 ? '' : strval($dbnum);
60 60
             $host = parse_config($config, sprintf('<replica%s_db_host>', $r));
61 61
             $name = parse_config($config, sprintf('<replica%s_db_name>', $r));
62 62
             $user = parse_config($config, sprintf('<replica%s_db_user>', $r));
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
         $db = BoincDb::get();
205 205
         return $db->update($this, 'user', $clause);
206 206
     }
207
-    static function enum($where_clause, $order_clause=null) {
207
+    static function enum($where_clause, $order_clause = null) {
208 208
         $db = BoincDb::get();
209 209
         return $db->enum('user', 'BoincUser', $where_clause, $order_clause);
210 210
     }
211
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
211
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
212 212
         $db = BoincDb::get();
213 213
         return $db->enum_fields(
214 214
             'user', 'BoincUser', $fields, $where_clause, $order_clause
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $db = BoincDb::get();
259 259
         return $db->update($this, 'team', $clause);
260 260
     }
261
-    static function enum($where_clause, $order_clause=null) {
261
+    static function enum($where_clause, $order_clause = null) {
262 262
         $db = BoincDb::get();
263 263
         return $db->enum('team', 'BoincTeam', $where_clause, $order_clause);
264 264
     }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         $db = BoincDb::get();
284 284
         return $db->max('team', $field);
285 285
     }
286
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
286
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
287 287
         $db = BoincDb::get();
288 288
         return $db->enum_fields(
289 289
             'team', 'BoincTeam', $fields, $where_clause, $order_clause
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
         $db = BoincDb::get();
322 322
         return $db->delete($this, 'host');
323 323
     }
324
-    static function enum($where_clause, $order_clause=null) {
324
+    static function enum($where_clause, $order_clause = null) {
325 325
         $db = BoincDb::get();
326 326
         return $db->enum('host', 'BoincHost', $where_clause, $order_clause);
327 327
     }
328
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
328
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
329 329
         $db = BoincDb::get();
330 330
         return $db->enum_fields(
331 331
             'host', 'BoincHost', $fields, $where_clause, $order_clause
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $db = BoincDb::get();
363 363
         return $db->enum('result', 'BoincResult', $where_clause);
364 364
     }
365
-	static function enum_fields($fields, $where_clause, $order_clause=null) {
365
+	static function enum_fields($fields, $where_clause, $order_clause = null) {
366 366
         $db = BoincDb::get();
367 367
 		return $db->enum_fields(
368 368
             'result', 'BoincResult', $fields, $where_clause, $order_clause
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         $db = BoincDb::get();
412 412
         return $db->enum('workunit', 'BoincWorkunit', $where_clause);
413 413
     }
414
-    static function enum_fields($fields, $where_clause, $order_clause=null) {
414
+    static function enum_fields($fields, $where_clause, $order_clause = null) {
415 415
         $db = BoincDb::get();
416 416
         return $db->enum_fields('workunit', 'BoincWorkunit', $fields, $where_clause, $order_clause);
417 417
     }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
         $db = BoincDb::get();
454 454
         return $db->update($this, 'app', $clause);
455 455
     }
456
-    static function sum($field, $clause=null) {
456
+    static function sum($field, $clause = null) {
457 457
         $db = BoincDb::get();
458 458
         return $db->sum('app', $field, $clause);
459 459
     }
@@ -511,11 +511,11 @@  discard block
 block discarded – undo
511 511
         $db = BoincDb::get();
512 512
         return $db->insert('profile', $clause);
513 513
     }
514
-    static function enum($where_clause=null, $order_clause=null) {
514
+    static function enum($where_clause = null, $order_clause = null) {
515 515
         $db = BoincDb::get();
516 516
         return $db->enum('profile', 'BoincProfile', $where_clause, $order_clause);
517 517
     }
518
-    static function enum_fields($fields, $where_clause=null, $order_clause=null) {
518
+    static function enum_fields($fields, $where_clause = null, $order_clause = null) {
519 519
         $db = BoincDb::get();
520 520
         return $db->enum_fields('profile', 'BoincProfile', $fields, $where_clause, $order_clause);
521 521
     }
@@ -910,12 +910,12 @@  discard block
 block discarded – undo
910 910
         return $db->enum('consent', 'BoincConsent', $where_clause);
911 911
     }
912 912
 
913
-    static function insert ($clause) {
913
+    static function insert($clause) {
914 914
         $db = BoincDb::get();
915 915
         return $db->insert('consent', $clause);
916 916
     }
917 917
 
918
-    static function update ($clause) {
918
+    static function update($clause) {
919 919
         $db = BoincDb::get();
920 920
         return $db->update_aux('consent', $clause);
921 921
     }
@@ -940,17 +940,17 @@  discard block
 block discarded – undo
940 940
         return $db->lookup('consent_type', 'BoincConsentType', $clause);
941 941
     }
942 942
 
943
-    static function enum($where_clause, $order_clause=null) {
943
+    static function enum($where_clause, $order_clause = null) {
944 944
         $db = BoincDb::get();
945 945
         return $db->enum('consent_type', 'BoincConsentType', $where_clause, $order_clause);
946 946
     }
947 947
 
948
-    static function insert ($clause) {
948
+    static function insert($clause) {
949 949
         $db = BoincDb::get();
950 950
         return $db->insert('consent_type', $clause);
951 951
     }
952 952
 
953
-    static function update ($clause) {
953
+    static function update($clause) {
954 954
         $db = BoincDb::get();
955 955
         return $db->update_aux('consent_type', $clause);
956 956
     }
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
         return $db->lookup('latest_consent', 'BoincLatestConsent', $clause);
977 977
     }
978 978
 
979
-    static function enum($where_clause, $order_clause=null) {
979
+    static function enum($where_clause, $order_clause = null) {
980 980
         $db = BoincDb::get();
981 981
         return $db->enum('latest_consent', 'BoincLatestConsent', $where_clause, $order_clause);
982 982
     }
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
 // apply this to any user-supplied strings used in queries
988 988
 //
989 989
 function boinc_real_escape_string($x) {
990
-    if (version_compare(phpversion(),"4.3.0")>=0) {
990
+    if (version_compare(phpversion(), "4.3.0") >= 0) {
991 991
         return BoincDb::escape_string($x);
992 992
     } else {
993 993
         $x = str_replace("'", "\'", $x);
Please login to merge, or discard this patch.
html/user/job_fpops.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $host = BoincHost::lookup_id($res->hostid);
36 36
             $hosts[$res->hostid] = $host;
37 37
         }
38
-        $fpops = $res->cpu_time * $host->p_fpops;
38
+        $fpops = $res->cpu_time*$host->p_fpops;
39 39
         $samples[] = $res->cpu_time;
40 40
         //$fpops /= 1e9;
41 41
         //echo "$res->cpu_time $fpops\n";
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 function show($samples) {
48
-    $x = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
48
+    $x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
49 49
     foreach ($samples as $s) {
50 50
         $x[(int)log10($s)] += 1;
51 51
     }
52
-    for ($i=0; $i<16; $i++) {
52
+    for ($i = 0; $i < 16; $i++) {
53 53
         echo sprintf("%d: %d\n", $i, $x[$i]);
54 54
     }
55 55
 }
Please login to merge, or discard this patch.
html/user/submit_example.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     $user_submit = BoincUserSubmit::lookup_userid($user->id);
159 159
     if (!$user_submit) return null;
160 160
     $a = array();
161
-    foreach($apps as $app) {
161
+    foreach ($apps as $app) {
162 162
         if ($user_submit->submit_all) {
163 163
             $a[] = $app;
164 164
         } else {
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
     $input_url = get_str('input_url');
236 236
     if (!$input_url) error_page("missing input URL");
237 237
     $param_lo = (double)get_str('param_lo');
238
-    if ($param_lo<0 || $param_lo>60) error_page("param lo must be in 0..60");
238
+    if ($param_lo < 0 || $param_lo > 60) error_page("param lo must be in 0..60");
239 239
     $param_hi = (double)get_str('param_hi');
240
-    if ($param_hi<0 || $param_hi>60 || $param_hi <= $param_lo) {
240
+    if ($param_hi < 0 || $param_hi > 60 || $param_hi <= $param_lo) {
241 241
         error_page("param hi must be in 0..60 and > param lo");
242 242
     }
243 243
     $param_inc = (double)get_str('param_inc');
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     $f->source = $input_url;
255 255
     $f->mode = 'semilocal';
256 256
 
257
-    for ($x=$param_lo; $x<$param_hi; $x += $param_inc) {
257
+    for ($x = $param_lo; $x < $param_hi; $x += $param_inc) {
258 258
         $job = new StdClass;
259 259
         $job->rsc_fpops_est = $x*1e9;
260 260
         $job->command_line = "--t $x";
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         "status",
344 344
         "Canonical instance<br><p class=\"text-muted\">click to see result page on BOINC server</p>"
345 345
     );
346
-    foreach($batch->jobs as $job) {
346
+    foreach ($batch->jobs as $job) {
347 347
         $id = (int)$job->id;
348 348
         $resultid = (int)$job->canonical_instance_id;
349 349
         if ($resultid) {
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         "Instance ID<br><p class=\"text-muted\">click for result page on BOINC server</p>",
387 387
         "State", "Output files"
388 388
     );
389
-    foreach($reply->instances as $inst) {
389
+    foreach ($reply->instances as $inst) {
390 390
         echo "<tr>
391 391
             <td><a href=result.php?resultid=$inst->id>$inst->id</a></td>
392 392
             <td>$inst->state</td>
Please login to merge, or discard this patch.
html/user/register.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 function reg_form() {
32 32
     $config = get_config();
33 33
     $disable_acct = parse_bool($config, "disable_account_creation");
34
-    page_head("Register",  null, null, null, boinc_recaptcha_get_head_extra());
34
+    page_head("Register", null, null, null, boinc_recaptcha_get_head_extra());
35 35
     echo "<h3>Create an account</h3>";
36 36
     form_start("create_account_action.php", "post");
37 37
     create_account_form(0, "download_software.php");
Please login to merge, or discard this patch.
html/user/create_account_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
     }
65 65
 }
66 66
 
67
-form_start("create_account_action.php","post");
67
+form_start("create_account_action.php", "post");
68 68
 create_account_form($teamid, $next_url);
69 69
 if (recaptcha_public_key()) {
70 70
     form_general("", boinc_recaptcha_get_html(recaptcha_public_key()));
Please login to merge, or discard this patch.