Passed
Pull Request — master (#6441)
by
unknown
09:23
created
html/user/top_hosts.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 $cache_args = "sort_by=$sort_by&offset=$offset";
63 63
 $cacheddata = get_cached_data(TOP_PAGES_TTL, $cache_args);
64
-if ($cacheddata){
64
+if ($cacheddata) {
65 65
     $data = unserialize($cacheddata);
66 66
 } else {
67 67
     $data = get_top_hosts($offset,$sort_by);
@@ -87,7 +87,8 @@  discard block
 block discarded – undo
87 87
 
88 88
 }
89 89
 
90
-if ($n==$hosts_per_page){ //If we aren't on the last page
90
+if ($n==$hosts_per_page) {
91
+//If we aren't on the last page
91 92
     $new_offset = $offset + $hosts_per_page;
92 93
     echo "<a href=top_hosts.php?sort_by=$sort_by&amp;offset=$new_offset>".tra("Next %1", $hosts_per_page)."</a>";
93 94
 }
Please login to merge, or discard this patch.
html/user/top_teams.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 }
33 33
 define('ITEM_LIMIT', 10000);
34 34
 
35
-function get_top_teams($offset, $sort_by, $type){
35
+function get_top_teams($offset, $sort_by, $type) {
36 36
     global $teams_per_page;
37 37
     $db = BoincDb::get(true);
38 38
     $type_clause = null;
39
-    if ($type){
39
+    if ($type) {
40 40
         $type_clause = "type=$type";
41 41
     }
42 42
     if ($sort_by == "total_credit") {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     $cache_args = "sort_by=$sort_by&offset=$offset$type_url";
76 76
     $cacheddata = get_cached_data(TOP_PAGES_TTL,$cache_args);
77 77
     //If we have got the data in cache
78
-    if ($cacheddata){
78
+    if ($cacheddata) {
79 79
         $data = unserialize($cacheddata); // use the cached data
80 80
     } else {
81 81
         //if not do queries etc to generate new data
@@ -115,7 +115,8 @@  discard block
 block discarded – undo
115 115
         echo "<a href=top_teams.php?sort_by=$sort_by&amp;offset=$new_offset".$type_url.">".tra("Previous %1", $teams_per_page)."</a> &middot; ";
116 116
 
117 117
     }
118
-    if ($n==$teams_per_page){ //If we aren't on the last page
118
+    if ($n==$teams_per_page) {
119
+//If we aren't on the last page
119 120
         $new_offset = $offset + $teams_per_page;
120 121
         echo "<a href=top_teams.php?sort_by=$sort_by&amp;offset=$new_offset".$type_url.">".tra("Next %1", $teams_per_page)."</a>";
121 122
     }
Please login to merge, or discard this patch.
html/ops/delete_spammers.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -368,7 +368,8 @@
 block discarded – undo
368 368
         $min_days = $argv[++$i];
369 369
     } else if ($argv[$i] == "--max_days") {
370 370
         $max_days = $argv[++$i];
371
-    } else if ($argv[$i] == "--days") {     // deprecated
371
+    } else if ($argv[$i] == "--days") {
372
+// deprecated
372 373
         $max_days = $argv[++$i];
373 374
     }
374 375
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincstats/boincstats.module 1 patch
Braces   +14 added lines, -18 removed lines patch added patch discarded remove patch
@@ -104,8 +104,7 @@  discard block
 block discarded – undo
104 104
   
105 105
   if ($myCache->isInCache($cache_name)) {
106 106
     $myCache->strokeFromCache($cache_name);
107
-  }
108
-  else {
107
+  } else {
109 108
     // Initialize dataset
110 109
     $dataset = array();
111 110
     $stats_xml = boincstats_get_project_stats('daily', $cpid);
@@ -114,9 +113,10 @@  discard block
 block discarded – undo
114 113
       for ($j = 30; $j < 90; $j++) {
115 114
         $dataset[] = (int) $stats_xml->records->record[$j];
116 115
       }
117
-    }
118
-    else {
119
-      for ($i = 0; $i <= $dataset_size; $i++) $dataset[] = 0;
116
+    } else {
117
+      for ($i = 0; $i <= $dataset_size; $i++) {
118
+          $dataset[] = 0;
119
+      }
120 120
     }
121 121
     
122 122
     // Get color configuration
@@ -226,8 +226,7 @@  discard block
 block discarded – undo
226 226
   
227 227
   if ($myCache->isInCache($cache_name)) {
228 228
     $myCache->strokeFromCache($cache_name);
229
-  }
230
-  else {
229
+  } else {
231 230
     // Initialize dataset
232 231
     $dataset = array();
233 232
     $stats_xml = boincstats_get_project_stats('daily');
@@ -236,9 +235,10 @@  discard block
 block discarded – undo
236 235
       for ($j = 30; $j < 90; $j++) {
237 236
         $dataset[] = (int) $stats_xml->records->record[$j];
238 237
       }
239
-    }
240
-    else {
241
-      for ($i = 0; $i <= 30; $i++) $dataset[] = 0;
238
+    } else {
239
+      for ($i = 0; $i <= 30; $i++) {
240
+          $dataset[] = 0;
241
+      }
242 242
     }
243 243
     
244 244
     // Create and populate the pData object
@@ -316,8 +316,7 @@  discard block
 block discarded – undo
316 316
           directory must be writeable by the web server.',
317 317
           array('@parent_dir' => dirname($cache_dir)), WATCHDOG_ERROR);
318 318
         return FALSE;
319
-      }
320
-      else {
319
+      } else {
321 320
         // Create the cache dir
322 321
         if (!mkdir($cache_dir, 0775)) {
323 322
           watchdog('boincstats', 'Failed to create @cache_dir directory. Check
@@ -326,8 +325,7 @@  discard block
 block discarded – undo
326 325
           return FALSE;
327 326
         }
328 327
       }
329
-    }
330
-    else {
328
+    } else {
331 329
       watchdog('boincstats', 'Cache directory at @cache_dir is not writeable.
332 330
         Please allow webserver write access.',
333 331
         array('@cache_dir' => $cache_dir), WATCHDOG_ERROR);
@@ -370,8 +368,7 @@  discard block
 block discarded – undo
370 368
   foreach ($get as $arg => $value) {
371 369
     if ($value !== NULL) {
372 370
       $args[] = "{$arg}=" . rawurlencode($value);
373
-    }
374
-    else {
371
+    } else {
375 372
       $args[] = $arg;
376 373
     }
377 374
   }
@@ -467,8 +464,7 @@  discard block
 block discarded – undo
467 464
       drupal_set_message(t('The BOINC stats system is not configured. Please
468 465
         !configure_it', array('!configure_it' => l(t('configure it now'),
469 466
           'admin/boinc/stats'))), 'error', FALSE);
470
-    }
471
-    else {
467
+    } else {
472 468
       drupal_set_message(t('There is a problem with the site. Please contact
473 469
         the system administrator.'), 'error', FALSE);
474 470
     }
Please login to merge, or discard this patch.
html/ops/show_log.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
27 27
     exit("Error: couldn't get log_dir from config file.");
28 28
 }
29 29
 
30
-if( isset($_GET["f"]) ){
30
+if( isset($_GET["f"]) ) {
31 31
     $f = $_GET["f"];
32 32
     $f = escapeshellcmd($f);
33 33
 } else {
34 34
     $f = "";
35 35
 }
36
-if( isset($_GET["s"]) ){
36
+if( isset($_GET["s"]) ) {
37 37
     $s = $_GET["s"];
38 38
     $s = escapeshellcmd($s);
39 39
 } else {
40 40
     $s = "";
41 41
 }
42
-if( isset($_GET["l"]) ){
42
+if( isset($_GET["l"]) ) {
43 43
     $l = (int)$_GET["l"];
44 44
 } else {
45 45
     $l = 0;
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/boincteam_forum.module 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -387,8 +387,7 @@
 block discarded – undo
387 387
     $team = node_load($nid);
388 388
     $output .= '<p>' . bts('You may create a message board for use by @team',
389 389
       array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>';
390
-  }
391
-  else {
390
+  } else {
392 391
     $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>';
393 392
   }
394 393
   $output .= '<ul>';
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
         $lidkey = array_search($chunk['hash'], $nodehashtable);
137 137
         if ($lidkey) {
138 138
           unset($nodehashtable[$lidkey]);
139
-        }
140
-        else {
139
+        } else {
141 140
 
142 141
           $result = db_query("
143 142
             INSERT INTO {locales_source}
@@ -150,8 +149,7 @@  discard block
 block discarded – undo
150 149
               'Added translation source strings for node @nid chunk @chunk.',
151 150
               array('@nid' => $node->nid, '@chunk' => $idx)
152 151
            );
153
-          }
154
-          else {
152
+          } else {
155 153
             drupal_set_message(
156 154
               t('ERROR: Unable to add translation source strings.'), 'error'
157 155
             );
@@ -248,12 +246,10 @@  discard block
 block discarded – undo
248 246
         $mess = 'DEBUG ' . l('BOINC translate', "filter/tips/$format") .' parsed on '.date('r').'<br />Execution time: '.$elapsed.' seconds.';
249 247
         drupal_set_message($mess, 'warning');
250 248
         return $ret;
251
-      }
252
-      else {
249
+      } else {
253 250
         return _boinctranslate_filter_process($text, $format, $mynid);
254 251
       }// if debug
255
-    }
256
-    else {
252
+    } else {
257 253
       return $text;
258 254
     }// if type
259 255
     break;
@@ -309,8 +305,7 @@  discard block
 block discarded – undo
309 305
   foreach ($parts as $key => $value) {
310 306
     if (preg_match('/(#SPLIT_TOKEN#)/', $value)) {
311 307
       $chunks[] = array ('delimiter' => $value,);
312
-    }
313
-    else {
308
+    } else {
314 309
       $cleaned = preg_replace('/\s|\n/', '', $value);
315 310
       if (!empty($cleaned)) {
316 311
         $chunks[] = array(
Please login to merge, or discard this patch.
html/user/forum_thread.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $postid = get_int('postid', true);
31 31
 $filter = get_str('filter', true);
32 32
 
33
-if ($filter != "false"){
33
+if ($filter != "false") {
34 34
     $filter = true;
35 35
 } else {
36 36
     $filter = false;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     $sort_style = $temp_sort_style;
81 81
 } else if ($sort_style) {
82 82
     $forum_style = 0;   // this is deprecated
83
-    if ($logged_in_user){
83
+    if ($logged_in_user) {
84 84
         $logged_in_user->prefs->thread_sorting = $sort_style;
85 85
         $logged_in_user->prefs->update("thread_sorting=$sort_style");
86 86
     } else {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     );
93 93
 } else {
94 94
     // get the sorting style from the user or a cookie
95
-    if ($logged_in_user){
95
+    if ($logged_in_user) {
96 96
         $sort_style = $logged_in_user->prefs->thread_sorting;
97 97
     } else {
98 98
         list($forum_style, $sort_style) = parse_forum_cookie();
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 
121 121
 if (false) {
122 122
 if ($forum->parent_type == 0) {
123
-    if ($category->is_helpdesk && !$thread->status){
124
-        if ($logged_in_user){
125
-            if ($thread->owner == $logged_in_user->id){
123
+    if ($category->is_helpdesk && !$thread->status) {
124
+        if ($logged_in_user) {
125
+            if ($thread->owner == $logged_in_user->id) {
126 126
                 if ($thread->replies !=0) {
127 127
                     // Show a "this question has been answered" to the author
128 128
                     echo "<p>";
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     // If logged in user is moderator, enable some extra features
190 190
     //
191 191
     if (is_moderator($logged_in_user, $forum)) {
192
-        if ($thread->hidden){
192
+        if ($thread->hidden) {
193 193
             show_button_small(
194 194
                 "forum_moderate_thread_action.php?action=unhide&amp;thread=".$thread->id."$tokens",
195 195
                 tra("Unhide"),
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 tra("Hide this thread")
203 203
             );
204 204
         }
205
-        if ($thread->sticky){
205
+        if ($thread->sticky) {
206 206
             show_button_small(
207 207
                 "forum_moderate_thread_action.php?action=desticky&amp;thread=".$thread->id."$tokens",
208 208
                 tra("Make unsticky"),
Please login to merge, or discard this patch.
drupal/sites/all/features/private_messages/private_messages.features.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
   list($module, $api) = func_get_args();
8 8
   if ($module == "panels_mini" && $api == "panels_default") {
9 9
     return array("version" => 1);
10
-  }
11
-  else if ($module == "strongarm" && $api == "strongarm") {
10
+  } else if ($module == "strongarm" && $api == "strongarm") {
12 11
     return array("version" => 1);
13 12
   }
14 13
 }
Please login to merge, or discard this patch.