Passed
Push — vko_simplify_artifacts_upload ( 190ccb...d73fb5 )
by Vitalii
35:43 queued 21:32
created
html/user/prefs_remove.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 $venue = get_str("venue");
30 30
 $confirmed = get_str("confirmed", true);
31 31
 $columns = get_int("cols", true);
32
-$c = $columns?"&cols=$columns":"";
32
+$c = $columns ? "&cols=$columns" : "";
33 33
 
34 34
 if ($confirmed) {
35 35
     if ($subset == "global") {
Please login to merge, or discard this patch.
html/user/forum_rate.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     $rating = post_int('rating', true);
35 35
     if (!$choice) $choice = get_str('choice', true);
36 36
 
37
-    if ($choice == SOLUTION or $choice=="p") {
37
+    if ($choice == SOLUTION or $choice == "p") {
38 38
         $rating = 1;
39 39
     } else {
40 40
         $rating = -1;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     // Make sure the user has the forum's minimum amount of RAC and total credit
54 54
     // before allowing them to rate a post.
55 55
     //
56
-    if ($user->total_credit<$forum->rate_min_total_credit || $user->expavg_credit<$forum->rate_min_expavg_credit) {
56
+    if ($user->total_credit < $forum->rate_min_total_credit || $user->expavg_credit < $forum->rate_min_expavg_credit) {
57 57
         error_page(tra("You need more average or total credit to rate a post."));
58 58
     }
59 59
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     $user = get_logged_in_user();
44 44
 
45 45
     if ($choice == null && ($rating == null || $rating > 2 || $rating < -2)) {
46
-        show_result_page(false, NULL, NULL, $choice);
46
+        show_result_page(false, null, null, $choice);
47 47
     }
48 48
 
49 49
     $post = BoincPost::lookup_id($post_id);
Please login to merge, or discard this patch.
html/user/pending.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     $sum = 0;
48 48
     echo "<pending_credit>\n";
49 49
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
50
-    foreach($results as $result) {
50
+    foreach ($results as $result) {
51 51
         echo "<result>\n";
52 52
         echo "    <resultid>".$result->id."</resultid>\n";
53 53
         echo "    <workunitid>".$result->workunitid."</workunitid>\n";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     start_table();
68 68
     echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n";
69 69
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
70
-    foreach($results as $result) {
70
+    foreach ($results as $result) {
71 71
         echo "<tr>\n";
72 72
         echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n";
73 73
         echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n";
Please login to merge, or discard this patch.
html/user/profile_menu.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 start_table();
42 42
 
43 43
 $today = getdate(time());
44
-$UOTD_heading = tra("User of the Day")." -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
44
+$UOTD_heading = tra("User of the Day")." -- ".$today['month']." ".$today['mday'].", ".$today['year'];
45 45
 row1($UOTD_heading);
46 46
 echo "<tr><td>";
47 47
     $profile = get_current_uotd();
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 row1(tra("User Profile Explorer"));
60 60
 echo "<tr><td>
61 61
     <ul>
62
-    <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>")."</li>
63
-    <li>".tra("Browse profiles %1 by country %2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>")."</li>
62
+    <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"".url_base()."user_profile/user_gallery_1.html\">", "</a>")."</li>
63
+    <li>".tra("Browse profiles %1 by country %2.", "<a href=\"".url_base()."user_profile/profile_country.html\">", "</a>")."</li>
64 64
     <li>".tra("Browse profiles %1 at random %2, %3 at random with pictures %2, or %4 at random without pictures %2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>",
65 65
             "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">")."</li>
66 66
 ";
67
-if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
67
+if (file_exists(PROFILE_PATH."profile_alpha.html")) {
68 68
     echo "<li>".tra("Alphabetical profile listings:")."<br>";
69 69
 
70
-    include( PROFILE_PATH . "profile_alpha.html" );
70
+    include(PROFILE_PATH."profile_alpha.html");
71 71
 }
72 72
 echo "</ul></td></tr>";
73 73
 
Please login to merge, or discard this patch.
html/user/add_venue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $subset = sanitize_tags(get_str("subset"));
28 28
 $venue = sanitize_tags(get_str("venue"));
29 29
 $columns = get_int("cols", true);
30
-$c = $columns?"&cols=$columns":"";
30
+$c = $columns ? "&cols=$columns" : "";
31 31
 check_venue($venue);
32 32
 check_subset($subset);
33 33
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $title = tra("Edit %1 preferences", subset_name($subset));
43 43
             if ($venue) $title = "$title for $venue";
44 44
             page_head($title);
45
-            $x = $venue?"&venue=$venue":"";
45
+            $x = $venue ? "&venue=$venue" : "";
46 46
 
47 47
             echo PREFS_FORM_DESC1;
48 48
             echo PREFS_FORM_ERROR_DESC;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $title = tra("Edit %1 preferences", subset_name($subset));
68 68
             if ($venue) $title = "$title for $venue";
69 69
             page_head($title);
70
-            $x = $venue?"&venue=$venue":"";
70
+            $x = $venue ? "&venue=$venue" : "";
71 71
 
72 72
             echo PREFS_FORM_ERROR_DESC;
73 73
 
Please login to merge, or discard this patch.
html/user/user_search.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     $y = [];
26 26
     $x[] = sprintf('%s%s',
27 27
         user_links($user, BADGE_HEIGHT_MEDIUM),
28
-        UNIQUE_USER_NAME?'':" (ID $user->id)"
28
+        UNIQUE_USER_NAME ? '' : " (ID $user->id)"
29 29
     );
30 30
     $y[] = null;
31 31
     if (!DISABLE_TEAMS) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     $where = "true";
109 109
     $search_string = get_str('search_string');
110 110
     if (strlen($search_string)) {
111
-        if (strlen($search_string)<3) {
111
+        if (strlen($search_string) < 3) {
112 112
             error_page(tra("search string must be at least 3 characters"));
113 113
         }
114 114
         $s = BoincDb::escape_string($search_string);
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
     $search_type = get_str('search_type', true);
141 141
     $order_clause = "id desc";
142 142
     if ($search_type == 'rac') {
143
-        $order_clause ="expavg_credit desc";
143
+        $order_clause = "expavg_credit desc";
144 144
     } else if ($search_type == 'total') {
145
-        $order_clause ="total_credit desc";
145
+        $order_clause = "total_credit desc";
146 146
     }
147 147
 
148 148
     $fields = "id, create_time, name, country, total_credit, expavg_credit, teamid, url, has_profile, donated";
149 149
     $users = BoincUser::enum_fields($fields, $where, "order by $order_clause limit 100");
150 150
     page_head(tra("User search results"));
151
-    $n=0;
151
+    $n = 0;
152 152
     foreach ($users as $user) {
153
-        if ($n==0) {
153
+        if ($n == 0) {
154 154
             start_table('table-striped');
155 155
             $x = ['Name'];
156 156
             $y = [null];
Please login to merge, or discard this patch.
html/user/user_permissions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     start_table('table-striped');
28 28
 
29 29
     $x = ['User'];
30
-    for ($i=0; $i<S_NFLAGS; $i++) {
30
+    for ($i = 0; $i < S_NFLAGS; $i++) {
31 31
         $x[] = $special_user_bitfield[$i];
32 32
     }
33 33
     $x[] = '';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
             $pref->userid
43 43
         );
44 44
         $x = ["$user->name ($user->id)"];
45
-        for ($j=0; $j<S_NFLAGS; $j++) {
45
+        for ($j = 0; $j < S_NFLAGS; $j++) {
46 46
             $bit = substr($pref->special_user, $j, 1);
47
-            $c = ($bit == 1)?"checked":"";
47
+            $c = ($bit == 1) ? "checked" : "";
48 48
             $x[] = sprintf(
49 49
                 '<input type="checkbox" name="role%d" value="1" %s>',
50 50
                 $j, $c
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     echo '<form action="user_permissions.php" method="POST">';
59 59
     $x = ['Add User ID: <input type="text" name="userid" size="6">'];
60
-    for ($j=0; $j<S_NFLAGS; $j++) {
60
+    for ($j = 0; $j < S_NFLAGS; $j++) {
61 61
         $x[] = sprintf(
62 62
             '<input type="checkbox" name="role%d" value="1">',
63 63
             $j
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     if (!$user) error_page('no user');
78 78
     BoincForumPrefs::lookup($user);
79 79
 
80
-    for ($i=0; $i<S_NFLAGS; $i++) {
80
+    for ($i = 0; $i < S_NFLAGS; $i++) {
81 81
         if (post_int("role$i", true) == 1) {
82 82
             $bitset .= '1';
83 83
             echo "<br> setting $i";
Please login to merge, or discard this patch.
html/project.sample/project_specific_prefs.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 //      Also error-check values, and return errors in $errors->*
34 34
 
35 35
 function option($name, $val) {
36
-    $x = ($name == $val) ?  "selected" : "";
36
+    $x = ($name == $val) ? "selected" : "";
37 37
     return "<option name='$name' $x>$name\n";
38 38
 }
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 if (APP_SELECT_PREFS) {
54 54
     $app_array = array();
55 55
     $apps = BoincApp::enum("deprecated=0");
56
-    foreach($apps as $app) {
56
+    foreach ($apps as $app) {
57 57
         $app_array[] = array($app->id, $app->user_friendly_name);
58 58
     }
59 59
 } else {
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 }
92 92
 
93 93
 function number_select($name, $max, $n) {
94
-    $sel = ($n == 0) ? "selected":"";
94
+    $sel = ($n == 0) ? "selected" : "";
95 95
     $x = "<select class=\"form-control input-sm\" name=$name> <option value=0 $sel>".tra("No limit")."</option>";
96
-    for ($i=1; $i<=$max; $i++) {
97
-        $sel = ($n == $i) ? "selected":"";
96
+    for ($i = 1; $i <= $max; $i++) {
97
+        $sel = ($n == $i) ? "selected" : "";
98 98
         $x .= "<option value=$i $sel>$i</option>";
99 99
     }
100 100
     $x .= "</select>";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     return tra("No limit");
107 107
 }
108 108
 
109
-function project_specific_prefs_edit($prefs, $error=false) {
109
+function project_specific_prefs_edit($prefs, $error = false) {
110 110
     global $app_array;
111 111
     if (COLOR_PREFS) {
112 112
         $x = $prefs->color_scheme;
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
             } else {
133 133
                 $present = true;
134 134
             }
135
-            $checked = $present?"checked":"";
135
+            $checked = $present ? "checked" : "";
136 136
             $x .= "<input type=checkbox name=app_id_$app_id $checked> $app_name<br>";
137 137
         }
138 138
         tooltip_row2(APP_SELECT_TOOLTIP, APP_SELECT_DESC, $x);
139
-        $checked = $prefs->allow_non_preferred_apps?"checked":"";
139
+        $checked = $prefs->allow_non_preferred_apps ? "checked" : "";
140 140
         row2(ACCEPT_ANY_DESC, "<input type=checkbox name=allow_non_preferred_apps $checked>");
141 141
     }
142 142
     if (NON_GRAPHICAL_PREF) {
143
-        $checked = $prefs->non_graphical?"checked":"";
143
+        $checked = $prefs->non_graphical ? "checked" : "";
144 144
         row2(
145 145
             NON_GRAPHICAL_DESC,
146 146
             "<input type=checkbox name=non_graphical $checked>"
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
     return $x;
217 217
 }
218 218
 
219
-function project_specific_prefs_show($prefs, $columns=false) {
219
+function project_specific_prefs_show($prefs, $columns = false) {
220 220
     global $app_array;
221 221
     if ($columns) {
222 222
         if (COLOR_PREFS) {
223
-            row_defs(COLOR_DESC,"color_scheme", "", "", $prefs);
223
+            row_defs(COLOR_DESC, "color_scheme", "", "", $prefs);
224 224
         }
225 225
         if (GFX_CPU_PREFS) {
226 226
             row_defs(MAX_GFX_CPU_PCT_DESC, "max_gfx_cpu_pct", "", "", $prefs);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             row2(ACCEPT_ANY_DESC, $prefs->allow_non_preferred_apps_text);
255 255
         }
256 256
         if (NON_GRAPHICAL_PREF) {
257
-            row2(NON_GRAPHICAL_DESC, $prefs->non_graphical?tra("yes"):tra("no"));
257
+            row2(NON_GRAPHICAL_DESC, $prefs->non_graphical ?tra("yes") : tra("no"));
258 258
         }
259 259
         if (MAX_JOBS_PREF) {
260 260
             row2(tra("Max # jobs"), limit_string($prefs->max_jobs));
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
         $cursor = 0;
278 278
         while ($thisxml = parse_next_element($prefs_xml, "<app_id>", $cursor)) {
279 279
             if (is_numeric($thisxml)) {
280
-                $n = (int) $thisxml;
280
+                $n = (int)$thisxml;
281 281
                 $prefs->app_ids[] = $n;
282 282
             }
283 283
         }
284 284
         $prefs->allow_non_preferred_apps = parse_element($prefs_xml, "<allow_non_preferred_apps>");
285
-        $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps?"yes":"no";
285
+        $prefs->allow_non_preferred_apps_text = $prefs->allow_non_preferred_apps ? "yes" : "no";
286 286
     }
287 287
     if (NON_GRAPHICAL_PREF) {
288 288
         $prefs->non_graphical = parse_bool($prefs_xml, "non_graphical");
Please login to merge, or discard this patch.
html/inc/stats_sites.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -147,11 +147,11 @@
 block discarded – undo
147 147
 
148 148
 function site_list($sites) {
149 149
     echo "<ul>\n";
150
-    for ($i=0; $i<count($sites); $i++) {
150
+    for ($i = 0; $i < count($sites); $i++) {
151 151
         $s = $sites[$i];
152 152
         $url = $s[0];
153 153
         $name = $s[1];
154
-        $comment = array_key_exists(2, $s)?$s[2]:"";
154
+        $comment = array_key_exists(2, $s) ? $s[2] : "";
155 155
         echo "<li><a href=\"$url\">$name</a> $comment\n";
156 156
     }
157 157
     echo "</ul>\n";
Please login to merge, or discard this patch.