Passed
Push — master ( a2b204...7db904 )
by Matthew
04:26
created
www/includes/easyparliament/templates/html/topic/topic.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,10 +58,12 @@
 block discarded – undo
58 58
                     to <a href="<?= $member_url ?>/votes">see all their votes</a>.
59 59
                 </p>
60 60
 
61
-              <?php else: ?>
61
+              <?php else {
62
+    : ?>
62 63
                 <ul class="vote-descriptions">
63 64
                   <?php
64 65
                   $policy_ids = array();
66
+}
65 67
 
66 68
                   foreach ($positions as $position) {
67 69
                       if (!in_array($position['policy_id'], $policy_ids)) {
Please login to merge, or discard this patch.
www/docs/alert/authed.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 $email = get_http_var('email');
17 17
 $sign = get_http_var('sign');
18 18
 $pid = get_http_var('pid');
19
-if (!$pid || !ctype_digit($pid)) print 'not valid';
20
-else {
19
+if (!$pid || !ctype_digit($pid)) {
20
+    print 'not valid';
21
+} else {
21 22
     $authed = auth_verify_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET, $sign);
22 23
     if ($authed) {
23 24
         $db = new ParlDB;
@@ -26,10 +27,11 @@  discard block
 block discarded – undo
26 27
             ':criteria' => 'speaker:' . $pid
27 28
             ));
28 29
         $already_signed = $q->rows();
29
-        if ($already_signed)
30
-            print "already signed";
31
-        else
32
-            print "not signed";
30
+        if ($already_signed) {
31
+                    print "already signed";
32
+        } else {
33
+                    print "not signed";
34
+        }
33 35
     } else {
34 36
         print "not authed";
35 37
     }
Please login to merge, or discard this patch.
www/docs/news/rdf.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 <?php
26 26
     $c = 0;
27 27
     foreach ($all_news as $id => $news_row) {
28
-        if ($c++ == 10) break;
28
+        if ($c++ == 10) {
29
+            break;
30
+        }
29 31
         list($title, $content, $date) = $news_row;
30 32
         $url = "https://www.theyworkforyou.com".news_individual_link($date, $title);
31 33
         print "<rdf:li rdf:resource=\"$url\" />\n";
@@ -39,7 +41,9 @@  discard block
 block discarded – undo
39 41
 <?php
40 42
     $c = 0;
41 43
     foreach ($all_news as $id => $news_row) {
42
-        if ($c++ == 10) break;
44
+        if ($c++ == 10) {
45
+            break;
46
+        }
43 47
         list($title, $content, $date) = $news_row;
44 48
         $url = "https://www.theyworkforyou.com".news_individual_link($date, $title);
45 49
         $excerpt = trim_characters(news_format_body($content), 0, 250);
Please login to merge, or discard this patch.
www/includes/easyparliament/user.php 1 patch
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -445,9 +445,15 @@  discard block
 block discarded – undo
445 445
                 // Generates the password ....
446 446
                 for ($x=0; $x < 6;) {
447 447
                     $y = rand(1,1000);
448
-                    if($y>350 && $y<601) $d=chr(rand(48,57));
449
-                    if($y<351) $d=chr(rand(65,90));
450
-                    if($y>600) $d=chr(rand(97,122));
448
+                    if($y>350 && $y<601) {
449
+                        $d=chr(rand(48,57));
450
+                    }
451
+                    if($y<351) {
452
+                        $d=chr(rand(65,90));
453
+                    }
454
+                    if($y>600) {
455
+                        $d=chr(rand(97,122));
456
+                    }
451 457
                     if ($d!=$o && !preg_match('#[O01lI]#', $d)) {
452 458
                         $o=$d; $pwd.=$d; $x++;
453 459
                     }
@@ -1171,8 +1177,12 @@  discard block
 block discarded – undo
1171 1177
 
1172 1178
     public function confirm_email($token, $redirect=true) {
1173 1179
         $arg = '';
1174
-        if (strstr($token, '::')) $arg = '::';
1175
-        if (strstr($token, '-')) $arg = '-';
1180
+        if (strstr($token, '::')) {
1181
+            $arg = '::';
1182
+        }
1183
+        if (strstr($token, '-')) {
1184
+            $arg = '-';
1185
+        }
1176 1186
         list($user_id, $registrationtoken) = explode($arg, $token);
1177 1187
 
1178 1188
         if (!is_numeric($user_id) || $registrationtoken == '') {
@@ -1254,8 +1264,12 @@  discard block
 block discarded – undo
1254 1264
 
1255 1265
         // Split the token into its parts.
1256 1266
         $arg = '';
1257
-        if (strstr($token, '::')) $arg = '::';
1258
-        if (strstr($token, '-')) $arg = '-';
1267
+        if (strstr($token, '::')) {
1268
+            $arg = '::';
1269
+        }
1270
+        if (strstr($token, '-')) {
1271
+            $arg = '-';
1272
+        }
1259 1273
         list($user_id, $registrationtoken) = explode($arg, $token);
1260 1274
 
1261 1275
         if (!is_numeric($user_id) || $registrationtoken == '') {
@@ -1385,15 +1399,19 @@  discard block
 block discarded – undo
1385 1399
         // not-logged-in users.
1386 1400
 
1387 1401
         $this->postcode = $pc;
1388
-        if (!headers_sent()) // if in debug mode
1402
+        if (!headers_sent()) {
1403
+            // if in debug mode
1389 1404
             setcookie (POSTCODE_COOKIE, $pc, time()+7*86400, "/", COOKIEDOMAIN);
1405
+        }
1390 1406
 
1391 1407
         twfy_debug('USER', "Set the cookie named '" . POSTCODE_COOKIE . " to '$pc' for " . COOKIEDOMAIN . " domain");
1392 1408
     }
1393 1409
 
1394 1410
     public function unset_postcode_cookie() {
1395
-        if (!headers_sent()) // if in debug mode
1411
+        if (!headers_sent()) {
1412
+            // if in debug mode
1396 1413
             setcookie (POSTCODE_COOKIE, '', time() - 3600, '/', COOKIEDOMAIN);
1414
+        }
1397 1415
     }
1398 1416
 
1399 1417
     // mostly here for updating from facebook where we do not need
Please login to merge, or discard this patch.
www/includes/easyparliament/searchlog.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
     public function add($searchlogdata) {
37 37
 
38 38
         $ip = getenv('REMOTE_ADDR');
39
-        if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { # Googlebot
39
+        if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) {
40
+# Googlebot
40 41
             return;
41 42
         }
42 43
         if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#simplepie|bot#i', $_SERVER['HTTP_USER_AGENT'])) {
Please login to merge, or discard this patch.
classes/Policies.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -366,14 +366,12 @@
 block discarded – undo
366 366
     public function limitToSet($set) {
367 367
 
368 368
         // Sanity check the set exists
369
-        if (isset($this->sets[$set]))
370
-        {
369
+        if (isset($this->sets[$set])) {
371 370
             $out = array();
372 371
             // Reassemble the new policies list based on the set.
373 372
             foreach ($this->sets[$set] as $set_policy)
374 373
             {
375
-                if (isset($this->policies[$set_policy]))
376
-                {
374
+                if (isset($this->policies[$set_policy])) {
377 375
                     $out[$set_policy] = $this->policies[$set_policy];
378 376
                 } else {
379 377
                     // if we've limited the policies to a single one then we only
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/search/by-person.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,8 @@
 block discarded – undo
111 111
                                 <?php if ( $house !=  HOUSE_TYPE_LORDS) { ?>
112 112
                                   <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?>
113 113
                                 <?php } ?>
114
-                              <?php } else { // no $pid ?>
114
+                              <?php } else {
115
+// no $pid ?>
115 116
                                 <?= $speaker['name'] ?>
116 117
                               <?php } ?>
117 118
                             </td>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_your_mp.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,6 @@
 block discarded – undo
1 1
 <div class="debate-speech__division__your-mp">
2
-  <?php if ( !isset($main_vote_mp) || ! $main_vote_mp) { /* $main_vote_mp is true if an MP has been requested via the URL */ ?>
2
+  <?php if ( !isset($main_vote_mp) || ! $main_vote_mp) {
3
+/* $main_vote_mp is true if an MP has been requested via the URL */ ?>
3 4
     <div class="your-mp__header">
4 5
       <h3>How your <?= $division['members']['singular'] ?> voted</h3>
5 6
       <p>
Please login to merge, or discard this patch.
www/docs/api/key.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,8 @@
 block discarded – undo
155 155
     # The subscription has been created, but it is possible that the
156 156
     # payment failed (card error), or we need to do 3DS or similar
157 157
     $pi = $invoice->payment_intent;
158
-    if (!$pi) { # Free plan
158
+    if (!$pi) {
159
+# Free plan
159 160
         return;
160 161
     }
161 162
     if ($pi->status == 'requires_payment_method' || $pi->status == 'requires_source') {
Please login to merge, or discard this patch.