Completed
Push — master ( a4bf3a...585786 )
by Sam
08:59 queued 03:28
created
scripts/alertmailer.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -339,7 +339,7 @@
 block discarded – undo
339 339
 
340 340
     $data .= '====================';
341 341
     $sentemails++;
342
-    mlog("SEND $sentemails : Sending email to $current[email] ... ");
342
+    mlog("send $sentemails : Sending email to $current[email] ... ");
343 343
     $d = array('to' => $current['email'], 'template' => $template);
344 344
     $m = array(
345 345
         'DATA' => $data,
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
         #        unset($SEARCHENGINE);
218 218
         $total_results = $data['info']['total_results'];
219 219
         $queries++;
220
-        mlog(", hits " . $total_results . ", time " . (getmicrotime()-$start) . "\n");
220
+        mlog(", hits " . $total_results . ", time " . (getmicrotime() - $start) . "\n");
221 221
     } else {
222 222
         mlog("  ACTION $active/$outof CACHE HIT : Using cached result for '$criteria_batch'\n");
223 223
         $data = $results[$criteria_batch];
Please login to merge, or discard this patch.
www/includes/easyparliament/alert.php 3 patches
Braces   +30 added lines, -13 removed lines patch added patch discarded remove patch
@@ -340,17 +340,20 @@  discard block
 block discarded – undo
340 340
     }
341 341
 
342 342
     public function check_token($token) {
343
-        if (!is_null($this->token_checked))
344
-            return $this->token_checked;
343
+        if (!is_null($this->token_checked)) {
344
+                    return $this->token_checked;
345
+        }
345 346
 
346 347
         $arg = strstr($token, '::') ? '::' : '-';
347 348
         $token_parts = explode($arg, $token);
348
-        if (count($token_parts) != 2)
349
-            return false;
349
+        if (count($token_parts) != 2) {
350
+                    return false;
351
+        }
350 352
 
351 353
         list($alert_id, $registrationtoken) = $token_parts;
352
-        if (!is_numeric($alert_id) || !$registrationtoken)
353
-            return false;
354
+        if (!is_numeric($alert_id) || !$registrationtoken) {
355
+                    return false;
356
+        }
354 357
 
355 358
         $q = $this->db->query("SELECT alert_id, email, criteria
356 359
                         FROM alerts
@@ -398,7 +401,9 @@  discard block
 block discarded – undo
398 401
     // If all goes well the alert will be confirmed.
399 402
     // The alert will be active when scripts run each day to send the actual emails.
400 403
     public function confirm($token) {
401
-        if (!($alert = $this->check_token($token))) return false;
404
+        if (!($alert = $this->check_token($token))) {
405
+            return false;
406
+        }
402 407
         $this->criteria = $alert['criteria'];
403 408
         $this->email = $alert['email'];
404 409
         $r = $this->db->query("UPDATE alerts SET confirmed = 1, deleted = 0 WHERE alert_id = :alert_id", array(
@@ -412,7 +417,9 @@  discard block
 block discarded – undo
412 417
     // and the deletion page has passed the token from the URL to here.
413 418
     // If all goes well the alert will be deleted.
414 419
     public function delete($token) {
415
-        if (!($alert = $this->check_token($token))) return false;
420
+        if (!($alert = $this->check_token($token))) {
421
+            return false;
422
+        }
416 423
         $r = $this->db->query("DELETE FROM alerts WHERE alert_id = :alert_id", array(
417 424
             ':alert_id' => $alert['id']
418 425
             ));
@@ -421,7 +428,9 @@  discard block
 block discarded – undo
421 428
     }
422 429
 
423 430
     public function delete_all($token) {
424
-        if (!($alert = $this->check_token($token))) return false;
431
+        if (!($alert = $this->check_token($token))) {
432
+            return false;
433
+        }
425 434
         $r = $this->db->query("DELETE FROM alerts WHERE email = :email", array(
426 435
             ':email' => $alert['email']
427 436
             ));
@@ -430,7 +439,9 @@  discard block
 block discarded – undo
430 439
     }
431 440
 
432 441
     public function suspend($token) {
433
-        if (!($alert = $this->check_token($token))) return false;
442
+        if (!($alert = $this->check_token($token))) {
443
+            return false;
444
+        }
434 445
         $r = $this->db->query("UPDATE alerts SET deleted = 2 WHERE alert_id = :alert_id", array(
435 446
             ':alert_id' => $alert['id']
436 447
             ));
@@ -439,7 +450,9 @@  discard block
 block discarded – undo
439 450
     }
440 451
 
441 452
     public function resume($token) {
442
-        if (!($alert = $this->check_token($token))) return false;
453
+        if (!($alert = $this->check_token($token))) {
454
+            return false;
455
+        }
443 456
         $r = $this->db->query("UPDATE alerts SET deleted = 0 WHERE alert_id = :alert_id", array(
444 457
             ':alert_id' => $alert['id']
445 458
             ));
@@ -460,8 +473,12 @@  discard block
 block discarded – undo
460 473
             }
461 474
         }
462 475
         $criteria = '';
463
-        if (count($words)) $criteria .= ($html?'<li>':'* ') . 'Mentions of [' . implode(' ', $words) . ']' . ($html?'</li>':'') . "\n";
464
-        if ($spokenby) $criteria .= ($html?'<li>':'* ') . "Things by " . implode(' or ', $spokenby) . ($html?'</li>':'') . "\n";
476
+        if (count($words)) {
477
+            $criteria .= ($html?'<li>':'* ') . 'Mentions of [' . implode(' ', $words) . ']' . ($html?'</li>':'') . "\n";
478
+        }
479
+        if ($spokenby) {
480
+            $criteria .= ($html?'<li>':'* ') . "Things by " . implode(' or ', $spokenby) . ($html?'</li>':'') . "\n";
481
+        }
465 482
         return $criteria;
466 483
     }
467 484
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@
 block discarded – undo
52 52
 // FUNCTION: fetch_between
53 53
 
54 54
     public function fetch_between($confirmed, $deleted, $start_date, $end_date) {
55
-      // Return summary data on all the alerts that were created between $start_date
56
-      // and $end_date (inclusive) and whose confirmed and deleted values match the booleans
57
-      // passed in $confirmed and $deleted
55
+        // Return summary data on all the alerts that were created between $start_date
56
+        // and $end_date (inclusive) and whose confirmed and deleted values match the booleans
57
+        // passed in $confirmed and $deleted
58 58
         $q = $this->db->query("SELECT   criteria, count(*) as cnt
59 59
             FROM     alerts
60 60
             WHERE    confirmed = :confirmed
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public $token_checked = null;
42 42
     private $alert_id = "";
43 43
     public $email = "";
44
-    public $criteria = "";		// Sets the terms that are used to produce the search results.
44
+    public $criteria = ""; // Sets the terms that are used to produce the search results.
45 45
 
46 46
     private $db;
47 47
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $contents = array('criteria' => $row['criteria'], 'count' => $row['cnt']);
73 73
             $data[] = $contents;
74 74
         }
75
-        $data = array ('alerts' => $data);
75
+        $data = array('alerts' => $data);
76 76
         return $data;
77 77
     }
78 78
 
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
             $data[] = $contents;
112 112
         }
113 113
         $info = "Alert";
114
-        $data = array ('info' => $info, 'data' => $data);
114
+        $data = array('info' => $info, 'data' => $data);
115 115
 
116 116
         return $data;
117 117
     }
118 118
 
119
-    public function add($details, $confirmation_email=false, $instantly_confirm=true) {
119
+    public function add($details, $confirmation_email = false, $instantly_confirm = true) {
120 120
 
121 121
         // Adds a new alert's info into the database.
122 122
         // Then calls another function to send them a confirmation email.
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             // This gives a code for their email address which is then joined
180 180
             // to the timestamp so as to provide a unique ID for each alert.
181 181
 
182
-            $token = substr( password_hash($details["email"] . microtime(), PASSWORD_BCRYPT), 29, 16 );
182
+            $token = substr(password_hash($details["email"] . microtime(), PASSWORD_BCRYPT), 29, 16);
183 183
 
184 184
             // Full stops don't work well at the end of URLs in emails,
185 185
             // so replace them. We won't be doing anything clever with the hash
@@ -252,19 +252,19 @@  discard block
 block discarded – undo
252 252
 
253 253
         $urltoken = $this->alert_id . '-' . $this->registrationtoken;
254 254
 
255
-        if ( isset($details['confirm_base']) && $details['confirm_base'] !== '' ) {
255
+        if (isset($details['confirm_base']) && $details['confirm_base'] !== '') {
256 256
             $confirmurl = $details['confirm_base'] . $urltoken;
257 257
         } else {
258 258
             $confirmurl = 'https://' . DOMAIN . '/A/' . $urltoken;
259 259
         }
260 260
 
261 261
         // Arrays we need to send a templated email.
262
-        $data = array (
262
+        $data = array(
263 263
             'to' 		=> $details['email'],
264 264
             'template' 	=> 'alert_confirmation'
265 265
         );
266 266
 
267
-        $merge = array (
267
+        $merge = array(
268 268
             'FIRSTNAME' 	=> 'THEY WORK FOR YOU',
269 269
             'LASTNAME' 		=> ' ALERT CONFIRMATION',
270 270
             'CONFIRMURL'	=> $confirmurl,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     }
281 281
 
282 282
     public function send_already_signedup_email($details) {
283
-        $data = array (
283
+        $data = array(
284 284
             'to' 		=> $details['email'],
285 285
             'template' 	=> 'alert_already_signedup'
286 286
         );
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $criteria = \MySociety\TheyWorkForYou\Utility\Alert::detailsToCriteria($details);
289 289
         $this->criteria = $criteria;
290 290
 
291
-        $merge = array (
291
+        $merge = array(
292 292
             'FIRSTNAME' 	=> 'THEY WORK FOR YOU',
293 293
             'LASTNAME' 		=> ' ALERT ALREADY SIGNED UP',
294 294
             'CRITERIA'	=> $this->criteria_pretty()
@@ -448,17 +448,17 @@  discard block
 block discarded – undo
448 448
     public function email() { return $this->email; }
449 449
     public function criteria() { return $this->criteria; }
450 450
     public function criteria_pretty($html = false) {
451
-        $criteria = explode(' ',$this->criteria);
451
+        $criteria = explode(' ', $this->criteria);
452 452
         $spokenby = array_values(\MySociety\TheyWorkForYou\Utility\Search::speakerNamesForIDs($this->criteria));
453 453
         $words = array();
454 454
         foreach ($criteria as $c) {
455
-            if (!preg_match('#^speaker:(\d+)#',$c,$m)) {
455
+            if (!preg_match('#^speaker:(\d+)#', $c, $m)) {
456 456
                 $words[] = $c;
457 457
             }
458 458
         }
459 459
         $criteria = '';
460
-        if (count($words)) $criteria .= ($html?'<li>':'* ') . 'Mentions of [' . implode(' ', $words) . ']' . ($html?'</li>':'') . "\n";
461
-        if ($spokenby) $criteria .= ($html?'<li>':'* ') . "Things by " . implode(' or ', $spokenby) . ($html?'</li>':'') . "\n";
460
+        if (count($words)) $criteria .= ($html ? '<li>' : '* ') . 'Mentions of [' . implode(' ', $words) . ']' . ($html ? '</li>' : '') . "\n";
461
+        if ($spokenby) $criteria .= ($html ? '<li>' : '* ') . "Things by " . implode(' or ', $spokenby) . ($html ? '</li>' : '') . "\n";
462 462
         return $criteria;
463 463
     }
464 464
 
Please login to merge, or discard this patch.
www/docs/divisions/division.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 if ($data['division']['house'] == 'pbc') {
59 59
     $location = '&ndash; in a Public Bill Committee';
60 60
 }
61
-$data['debate_time_human'] = False;
61
+$data['debate_time_human'] = false;
62 62
 $data['debate_day_human'] = format_date($data['division']['date'], LONGDATEFORMAT);
63 63
 $data['col_country'] = $country;
64 64
 $data['location'] = $location;
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@
 block discarded – undo
45 45
             $data['mp_vote']['with_majority'] = true;
46 46
         }
47 47
     } else {
48
-      if ($data['division']['date'] < $MEMBER->entered_house($division_votes['house_number'])['date']) {
49
-          $data['before_mp'] = true;
50
-      } else if ($data['division']['date'] > $MEMBER->left_house($division_votes['house_number'])['date']) {
51
-          $data['after_mp'] = true;
52
-      }
48
+        if ($data['division']['date'] < $MEMBER->entered_house($division_votes['house_number'])['date']) {
49
+            $data['before_mp'] = true;
50
+        } else if ($data['division']['date'] > $MEMBER->left_house($division_votes['house_number'])['date']) {
51
+            $data['after_mp'] = true;
52
+        }
53 53
     }
54 54
 
55 55
     $mp_data = array(
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_votes.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@
 block discarded – undo
38 38
 
39 39
 $vote_sets = array(
40 40
     'yes_votes' => array(
41
-      'title' => 'Aye',
42
-      'anchor' => 'for',
41
+        'title' => 'Aye',
42
+        'anchor' => 'for',
43 43
     ),
44 44
     'no_votes' => array(
45
-      'title' => 'No',
46
-      'anchor' => 'against',
45
+        'title' => 'No',
46
+        'anchor' => 'against',
47 47
     ),
48 48
     'absent_votes' => array(
49
-      'title' => 'Absent',
50
-      'anchor' => 'absent',
49
+        'title' => 'Absent',
50
+        'anchor' => 'absent',
51 51
     ),
52 52
     'both_votes' => array(
53
-      'title' => 'Abstained',
54
-      'anchor' => 'both',
53
+        'title' => 'Abstained',
54
+        'anchor' => 'both',
55 55
     ),
56 56
 );
57 57
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
 });
25 25
 $sections_with_votes = array_values($sections_with_votes);
26 26
 
27
-for ($i=0; $i<count($sections_with_votes); $i+=2) {
27
+for ($i = 0; $i < count($sections_with_votes); $i += 2) {
28 28
     $l = $sections_with_votes[$i];
29
-    $r = $i+1 < count($sections_with_votes) ? $sections_with_votes[$i+1] : null;
29
+    $r = $i + 1 < count($sections_with_votes) ? $sections_with_votes[$i + 1] : null;
30 30
 
31 31
     $vote_title = $vote_sets[$l]['title'];
32 32
     $anchor = $vote_sets[$l]['anchor'];
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_your_mp.php 3 patches
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.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 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) { /* $main_vote_mp is true if an MP has been requested via the URL */ ?>
3 3
     <div class="your-mp__header">
4 4
       <h3>How your <?= $division['members']['singular'] ?> voted</h3>
5 5
       <p>
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     </div>
10 10
   <?php } ?>
11 11
     <a href="<?= $data['mp_data']['mp_url'] ?>" class="your-mp__content">
12
-      <?php if ( isset($mp_vote) ) { ?>
12
+      <?php if (isset($mp_vote)) { ?>
13 13
         <span class="your-mp__vote your-mp__vote--<?= $mp_vote['vote'] ?>"><?php
14 14
           switch ($mp_vote['vote']) {
15 15
               case 'aye':
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                   echo 'N/A';
34 34
           }
35 35
         ?></span>
36
-      <?php } else if ( isset($before_mp) || isset($after_mp) ) { ?>
36
+      <?php } else if (isset($before_mp) || isset($after_mp)) { ?>
37 37
         <span class="your-mp__vote">N/A</span>
38 38
       <?php } ?>
39 39
         <img class="your-mp__image" src="<?= $data['mp_data']['image'] ?>">
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             <h2 class="people-list__person__name"><?= $data['mp_data']['name'] ?></h2>
42 42
             <p class="people-list__person__memberships">
43 43
                 <span class="people-list__person__constituency"><?= $data['mp_data']['constituency'] ?></span>
44
-                <span class="people-list__person__party <?= slugify( $data['mp_data']['party'] ) ?>"><?= $data['mp_data']['party'] ?></span>
44
+                <span class="people-list__person__party <?= slugify($data['mp_data']['party']) ?>"><?= $data['mp_data']['party'] ?></span>
45 45
             </p>
46 46
         </div>
47 47
     </a>
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
11 11
     <a href="<?= $data['mp_data']['mp_url'] ?>" class="your-mp__content">
12 12
       <?php if ( isset($mp_vote) ) { ?>
13 13
         <span class="your-mp__vote your-mp__vote--<?= $mp_vote['vote'] ?>"><?php
14
-          switch ($mp_vote['vote']) {
15
-              case 'aye':
14
+            switch ($mp_vote['vote']) {
15
+                case 'aye':
16 16
                   echo 'Aye';
17
-                  break;
18
-              case 'no':
17
+                    break;
18
+                case 'no':
19 19
                   echo 'No';
20
-                  break;
21
-              case 'absent':
20
+                    break;
21
+                case 'absent':
22 22
                   echo 'Absent';
23
-                  break;
24
-              case 'both':
23
+                    break;
24
+                case 'both':
25 25
                   echo 'Abstain';
26
-                  break;
27
-              case 'tellaye':
26
+                    break;
27
+                case 'tellaye':
28 28
                   echo 'Aye (Teller)';
29
-                  break;
30
-              case 'tellno':
29
+                    break;
30
+                case 'tellno':
31 31
                   echo 'No (Teller)';
32
-                  break;
33
-              default:
32
+                    break;
33
+                default:
34 34
                   echo 'N/A';
35
-          }
35
+            }
36 36
         ?></span>
37 37
       <?php } else if ( isset($before_mp) || isset($after_mp) ) { ?>
38 38
         <span class="your-mp__vote">N/A</span>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/alert/_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <h3>Your current email alerts</h3>
2 2
 
3 3
 <ul class="alerts-manage__list">
4
-  <?php foreach ( $alerts as $alert ) { ?>
4
+  <?php foreach ($alerts as $alert) { ?>
5 5
     <li>
6 6
         When <?= _htmlspecialchars($alert['criteria']) ?>.
7 7
         <form action="<?= $actionurl ?>" method="POST">
8 8
             <input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>">
9
-          <?php if ( $alert['status'] == 'unconfirmed' ) { ?>
9
+          <?php if ($alert['status'] == 'unconfirmed') { ?>
10 10
             <input type="submit" class="button small" name="action" value="Confirm">
11
-          <?php } elseif ( $alert['status'] == 'suspended' ) { ?>
11
+          <?php } elseif ($alert['status'] == 'suspended') { ?>
12 12
             <input type="submit" class="button small" name="action" value="Resume">
13 13
           <?php } else { ?>
14 14
             <input type="submit" class="button button--secondary small" name="action" value="Suspend">
Please login to merge, or discard this patch.
classes/Utility/Alert.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         }
20 20
 
21 21
         if (!empty($details['pid'])) {
22
-            $criteria[] = 'speaker:'.$details['pid'];
22
+            $criteria[] = 'speaker:' . $details['pid'];
23 23
         }
24 24
 
25 25
         $criteria = join(' ', $criteria);
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
             $token = $row['alert_id'] . '-' . $row['registrationtoken'];
42 42
 
43 43
             $status = 'confirmed';
44
-            if ( !$row['confirmed'] ) {
44
+            if (!$row['confirmed']) {
45 45
                 $status = 'unconfirmed';
46
-            } elseif ( $row['deleted'] == 2 ) {
46
+            } elseif ($row['deleted'] == 2) {
47 47
                 $status = 'suspended';
48 48
             }
49 49
 
@@ -60,21 +60,21 @@  discard block
 block discarded – undo
60 60
 
61 61
     public static function prettifyCriteria($alert_criteria) {
62 62
         $text = '';
63
-        if ( $alert_criteria ) {
63
+        if ($alert_criteria) {
64 64
             $criteria = explode(' ', $alert_criteria);
65 65
             $words = array();
66 66
             $spokenby = array_values(\MySociety\TheyWorkForYou\Utility\Search::speakerNamesForIDs($alert_criteria));
67 67
 
68 68
             foreach ($criteria as $c) {
69
-                if (!preg_match('#^speaker:(\d+)#',$c,$m)) {
69
+                if (!preg_match('#^speaker:(\d+)#', $c, $m)) {
70 70
                     $words[] = $c;
71 71
                 }
72 72
             }
73
-            if ( $spokenby && count($words) ) {
73
+            if ($spokenby && count($words)) {
74 74
                 $text = implode(' or ', $spokenby) . ' mentions [' . implode(' ', $words) . ']';
75
-            } else if ( count( $words ) ) {
75
+            } else if (count($words)) {
76 76
                 $text = '[' . implode(' ', $words) . ']' . ' is mentioned';
77
-            } else if ( $spokenby ) {
77
+            } else if ($spokenby) {
78 78
                 $text = implode(' or ', $spokenby) . " speaks";
79 79
             }
80 80
         }
Please login to merge, or discard this patch.
www/docs/section.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
     if (isset($THEUSER) && $THEUSER->postcode_is_set()) {
22 22
         try {
23 23
             $MEMBER = new MySociety\TheyWorkForYou\Member(array('postcode' => $THEUSER->postcode(), 'house' => \MySociety\TheyWorkForYou\Utility\House::majorToHouse($view->major)[0]));
24
-        } catch ( MySociety\TheyWorkForYou\MemberException $e ) {
24
+        } catch (MySociety\TheyWorkForYou\MemberException $e) {
25 25
             $MEMBER = null;
26 26
         }
27 27
     }
28 28
 
29 29
     $data = $view->display();
30 30
     if ($data) {
31
-        if ( !empty($data['template']) ) {
31
+        if (!empty($data['template'])) {
32 32
             $template = $data['template'];
33 33
         } else {
34 34
             $template = 'section/section';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 }
14 14
 
15 15
 if ($type = ucfirst(get_http_var('type'))) {
16
-    $class_name = "MySociety\TheyWorkForYou\SectionView\\${type}View";
16
+    $class_name = "MySociety\TheyWorkForYou\SectionView\\${type}view";
17 17
     $view = new $class_name();
18 18
 
19 19
     // use this for generating member vote data
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/vote.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
                   <?php if (isset($data['mp_data'])) {
29 29
                     include('_your_mp.php');
30
-                  } ?>
30
+                    } ?>
31 31
 
32 32
                     <div class="debate-speech__division__details">
33 33
                       <p>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
                           </span><br>
38 38
                       <?php } else { ?>
39 39
                           <?php if ($mp_vote['with_majority']) { ?>
40
-                              <?php $vote_prefix = 'A majority of ' . $division['members']['plural']  . ' <b>agreed</b> and'; include('_vote_description.php'); ?>
40
+                              <?php $vote_prefix = 'A majority of ' . $division['members']['plural'] . ' <b>agreed</b> and'; include('_vote_description.php'); ?>
41 41
                           <?php } else { ?>
42 42
                               <?php $vote_prefix = 'A majority of ' . $division['members']['plural'] . ' <b>disagreed</b> and'; include('_vote_description.php'); ?>
43 43
                           <?php } ?>
Please login to merge, or discard this patch.