Passed
Pull Request — master (#1389)
by Struan
32:57
created
classes/Divisions.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $policy_maxes = array();
50 50
         $row_count = $q->rows();
51 51
         for ($n = 0; $n < $row_count; $n++) {
52
-            $policy_maxes[$q->field($n, 'policy_id')] = $q->field( $n, 'recent' );
52
+            $policy_maxes[$q->field($n, 'policy_id')] = $q->field($n, 'recent');
53 53
         }
54 54
         $policy_maxes['latest'] = $policy_maxes ? max(array_values($policy_maxes)) : '';
55 55
         return $policy_maxes;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     public function getMemberDivisionsForPolicy($policyID = null) {
117 117
         $where_extra = '';
118 118
         $args = array(':person_id' => $this->member->person_id);
119
-        if ( $policyID ) {
119
+        if ($policyID) {
120 120
             $where_extra = 'AND policy_id = :policy_id';
121 121
             $args[':policy_id'] = $policyID;
122 122
         }
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
 
175 175
           $vote = $q->field($n, 'vote');
176 176
           $policy_vote = str_replace('3', '', $q->field($n, 'policy_vote'));
177
-          if ( $vote == 'absent' ) {
177
+          if ($vote == 'absent') {
178 178
               $summary['absent'] += $q->field($n, 'total');
179
-          } else if ( $vote == 'both' ) {
179
+          } else if ($vote == 'both') {
180 180
               $summary['both'] += $q->field($n, 'total');
181
-          } else if ( strpos($vote, 'tell') !== FALSE ) {
181
+          } else if (strpos($vote, 'tell') !== FALSE) {
182 182
               $summary['tell'] += $q->field($n, 'total');
183
-          } else if ( $policy_vote == $vote ) {
183
+          } else if ($policy_vote == $vote) {
184 184
               $summary['for'] += $q->field($n, 'total');
185
-          } else if ( $policy_vote != $vote ) {
185
+          } else if ($policy_vote != $vote) {
186 186
               $summary['against'] += $q->field($n, 'total');
187 187
           }
188 188
 
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
 
271 271
         foreach ($votes as $vote => $count) { // array('yes_votes', 'no_votes', 'absent_votes', 'both_votes') as $vote) {
272 272
           $votes[$vote . '_by_party'] = $votes[$vote];
273
-          usort($votes[$vote . '_by_party'], function ($a, $b) {
274
-                return $a['party']>$b['party'];
273
+          usort($votes[$vote . '_by_party'], function($a, $b) {
274
+                return $a['party'] > $b['party'];
275 275
             });
276 276
         }
277 277
 
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
             $votes['against'] . ' ' . make_plural('vote', $votes['against']) . ' against'
312 312
         );
313 313
 
314
-        if ( $votes['both'] ) {
314
+        if ($votes['both']) {
315 315
             $actions[] = $votes['both'] . ' ' . make_plural('abstention', $votes['both']);
316 316
         }
317
-        if ( $votes['absent'] ) {
317
+        if ($votes['absent']) {
318 318
             $actions[] = $votes['absent'] . ' ' . make_plural('absence', $votes['absent']);
319 319
         }
320 320
         if ($max == $min) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
     private function constructYesNoVoteDescription($direction, $title, $short_text) {
381 381
         $text = ' voted ';
382
-        if ( $short_text ) {
382
+        if ($short_text) {
383 383
             $text .= $short_text;
384 384
         } else {
385 385
             $text .= "$direction on <em>$title</em>";
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
          * votes so we need to generate some text using the title of the division
398 398
          */
399 399
 
400
-        switch ( strtolower($vote) ) {
400
+        switch (strtolower($vote)) {
401 401
             case 'yes':
402 402
             case 'aye':
403 403
                 $description = $this->constructYesNoVoteDescription('yes', $division_title, $yes_text);
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
         if (array_key_exists('direction', $row)) {
447 447
             $division['direction'] = $row['direction'];
448
-            if ( strpos( $row['direction'], 'strong') !== FALSE ) {
448
+            if (strpos($row['direction'], 'strong') !== FALSE) {
449 449
                 $division['strong'] = TRUE;
450 450
             } else {
451 451
                 $division['strong'] = FALSE;
@@ -489,24 +489,24 @@  discard block
 block discarded – undo
489 489
         for ($n = 0; $n < $row_count; $n++) {
490 490
             $policy_id = $q->field($n, 'policy_id');
491 491
 
492
-            if ( !array_key_exists($policy_id, $policies) ) {
492
+            if (!array_key_exists($policy_id, $policies)) {
493 493
                 $policies[$policy_id] = array(
494 494
                     'policy_id' => $policy_id,
495 495
                     'weak_count' => 0,
496 496
                     'divisions' => array()
497 497
                 );
498
-                if ( $this->policies ) {
498
+                if ($this->policies) {
499 499
                     $policies[$policy_id]['desc'] = $this->policies->getPolicies()[$policy_id];
500 500
                     $policies[$policy_id]['header'] = $this->policies->getPolicyDetails($policy_id);
501 501
                 }
502
-                if ( $this->positions ) {
502
+                if ($this->positions) {
503 503
                     $policies[$policy_id]['position'] = $this->positions->positionsById[$policy_id];
504 504
                 }
505 505
             }
506 506
 
507 507
             $division = $this->getDivisionDetails($q->row($n));
508 508
 
509
-            if ( !$division['strong'] ) {
509
+            if (!$division['strong']) {
510 510
                 $policies[$policy_id]['weak_count']++;
511 511
             }
512 512
 
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
 
522 522
         $gid = get_canonical_gid($gid);
523 523
 
524
-        $q = $this->db->query("SELECT gid, major FROM hansard WHERE epobject_id = ( SELECT subsection_id FROM hansard WHERE gid = :gid )", array( ':gid' => $gid ));
524
+        $q = $this->db->query("SELECT gid, major FROM hansard WHERE epobject_id = ( SELECT subsection_id FROM hansard WHERE gid = :gid )", array(':gid' => $gid));
525 525
         $parent_gid = $q->field(0, 'gid');
526
-        if ( !$parent_gid ) {
526
+        if (!$parent_gid) {
527 527
             return '';
528 528
         }
529 529
         $parent_gid = fix_gid_from_db($parent_gid);
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_name_vote_list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!function_exists('print_voter')) {
4
-  function print_voter($vote){
4
+  function print_voter($vote) {
5 5
     echo sprintf(
6 6
       '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s</span></li>',
7 7
       $vote['person_id'],
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     <?php if (count($tellers) > 0) { ?>
28 28
       <h4>Tellers</h4>
29 29
       <ul class="division-names">
30
-        <?php foreach($tellers as $teller) {
30
+        <?php foreach ($tellers as $teller) {
31 31
           print_voter($teller);
32 32
         } ?>
33 33
       </p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/people/index.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                           Based on postcode <strong><?= $mp_data['postcode'] ?></strong>
27 27
                           <a href="<?= $mp_data['change_url'] ?>">(Change postcode)</a>
28 28
                       </p>
29
-                    <?php if ( isset( $mp_data ) && $type != 'mlas' ) { ?>
29
+                    <?php if (isset($mp_data) && $type != 'mlas') { ?>
30 30
                       <h3>Your <?= $mp_data['former'] ? $mp_data['former'] . ' ' : '' ?><?= $rep_name ?> is</h3>
31 31
                     </div>
32 32
                     <a href="<?= $mp_data['mp_url'] ?>" class="people-list__person">
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
                         </p>
39 39
                     </a>
40 40
                     <?php }
41
-                    if ( isset($reps) ) {
42
-                        if ( isset($mp_data) && $type != 'mlas' ) { ?>
41
+                    if (isset($reps)) {
42
+                        if (isset($mp_data) && $type != 'mlas') { ?>
43 43
                     <div class="people-list__your-mp__replist-header">
44 44
                         <?php } ?>
45 45
                       <h3>Your <?=$former ?> <?= $rep_plural == 'MSPs' ? 'regional ' : '' ?><?= $rep_plural ?> are</h3>
46 46
                     </div>
47
-                        <?php foreach ( $reps as $rep ) { ?>
47
+                        <?php foreach ($reps as $rep) { ?>
48 48
                     <a href="<?= $rep['mp_url'] ?>" class="people-list__person">
49 49
                     <img class="people-list__person__image" src="<?= $rep['image'] ?>">
50 50
                         <h2 class="people-list__person__name"><?= $rep['name'] ?></h2>
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
             <div class="search-page__section search-page__section--search">
66 66
                 <div class="search-page__section__primary">
67 67
                     <p class="search-page-main-inputs">
68
-                    <?php if ( $type == 'peers' ) { ?>
68
+                    <?php if ($type == 'peers') { ?>
69 69
                         <label for="find-mp-by-name-or-postcode">Find <?= $rep_plural ?> by name:</label>
70
-                    <?php } elseif ( $type == 'mlas' || $type == 'msps' ) { ?>
70
+                    <?php } elseif ($type == 'mlas' || $type == 'msps') { ?>
71 71
                         <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by postcode:</label>
72 72
                     <?php } else { ?>
73 73
                         <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by name or postcode:</label>
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
             <div class="search-page__section__primary">
109 109
             <h2>All <?= $rep_plural ?></h2>
110 110
 
111
-                <?php if ( $type != 'peers' ) { ?>
111
+                <?php if ($type != 'peers') { ?>
112 112
                 <ul class="search-result-display-options">
113
-                    <?php if ( $order == 'given_name' ) { ?>
113
+                    <?php if ($order == 'given_name') { ?>
114 114
                     <li><strong>Sorted by</strong> First name</li>
115 115
                     <li>Sort by <a href="<?= $urls['by_last'] ?>">Last name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li>
116
-                    <?php } else if ( $order == 'party' ) { ?>
116
+                    <?php } else if ($order == 'party') { ?>
117 117
                     <li><strong>Sorted by</strong> Party</li>
118 118
                     <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_last'] ?>">Last name</a></li>
119 119
                     <?php } else { ?>
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 </ul>
124 124
                 <?php } else { ?>
125 125
                 <ul class="search-result-display-options">
126
-                    <?php if ( $order == 'party' ) { ?>
126
+                    <?php if ($order == 'party') { ?>
127 127
                     <li><strong>Sorted by</strong> Party</li>
128 128
                     <li>Sort by <a href="<?= $urls['by_name'] ?>">Name</a></li>
129 129
                     <?php } else { ?>
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
                     }
174 174
                 }
175 175
                 $initial_link = '';
176
-                foreach ( $data as $person ) {
176
+                foreach ($data as $person) {
177 177
                     if ($order != 'party') {
178
-                        $initial = substr( strtoupper($person[$a_to_z_key]), 0, 1);
179
-                        if ( $initial != $current_initial ) {
178
+                        $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1);
179
+                        if ($initial != $current_initial) {
180 180
                             $current_initial = $initial;
181 181
                             $initial_link = "name=\"$initial\" ";
182 182
                         } else {
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 <img class="people-list__person__image" src="<?= $person['image'] ?>">
189 189
                         <h2 class="people-list__person__name"><?= ucfirst($person['name']) ?></h2>
190 190
                         <p class="people-list__person__memberships">
191
-                        <?php if ( $person['constituency'] ) { ?>
191
+                        <?php if ($person['constituency']) { ?>
192 192
                         <span class="people-list__person__constituency"><?= $person['constituency'] ?></span>
193 193
                         <?php } ?>
194 194
                         <span class="people-list__person__party <?= slugify($person['party']) ?>"><?= $person['party'] ?></span>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 <a href="<?= $urls['by_csv'] ?>">Download this list as a CSV</a>
207 207
                     suitable for Excel
208 208
                 </p>
209
-                <?php if ( $type == 'mps' ) { ?>
209
+                <?php if ($type == 'mps') { ?>
210 210
                 <form method="get" action="<?= $urls['plain'] ?>" class="sidebar-item-with-icon sidebar-item-with-icon--date">
211 211
                     <p>
212 212
                         Or view a past list
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                   })
259 259
                 });
260 260
                 </script>
261
-                <?php } else if ( $type == 'msps' ) { ?>
261
+                <?php } else if ($type == 'msps') { ?>
262 262
                     <p class="past-list-dates" id="past-list-dates">
263 263
                         <a href="<?= $urls['plain'] ?>?date=2011-05-05">MSPs at 2011 election</a>
264 264
                         <a href="<?= $urls['plain'] ?>?date=2007-05-03">MSPs at 2007 election</a>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                     </p>
273 273
                 <?php } ?>
274 274
 
275
-                <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?>
275
+                <?php include(dirname(__FILE__) . '/../sidebar/looking_for.php') ?>
276 276
             </div>
277 277
         </div>
278 278
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_votes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@
 block discarded – undo
55 55
     ),
56 56
 );
57 57
 
58
-foreach ( $division_sections as $s ) {
59
-    $vote_title = $vote_sets[ $s['thekey'] ]['title'];
60
-    $anchor = $vote_sets[ $s['thekey'] ]['anchor'];
61
-    $summary = $division['party_breakdown'][ $s['thekey'] ];
58
+foreach ($division_sections as $s) {
59
+    $vote_title = $vote_sets[$s['thekey']]['title'];
60
+    $anchor = $vote_sets[$s['thekey']]['anchor'];
61
+    $summary = $division['party_breakdown'][$s['thekey']];
62 62
 
63
-    if ( $s['style'] == 'dot_vote_list' ) {
64
-        $votes = $division[ $s['thekey'] . '_by_party' ];
63
+    if ($s['style'] == 'dot_vote_list') {
64
+        $votes = $division[$s['thekey'] . '_by_party'];
65 65
         include '_dot_vote_list.php';
66 66
 
67
-    } else if ( $s['style'] == 'name_vote_list' ) {
68
-        $votes = $division[ $s['thekey'] ];
67
+    } else if ($s['style'] == 'name_vote_list') {
68
+        $votes = $division[$s['thekey']];
69 69
         include '_name_vote_list.php';
70 70
     }
71 71
 }
Please login to merge, or discard this patch.
www/docs/section.php 1 patch
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.
www/includes/easyparliament/templates/html/divisions/_your_mp.php 1 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.
www/includes/easyparliament/templates/html/section/_section_content.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-  <?php foreach($data['rows'] as $speech) { ?>
1
+  <?php foreach ($data['rows'] as $speech) { ?>
2 2
 
3 3
     <?php
4 4
 
@@ -61,27 +61,27 @@  discard block
 block discarded – undo
61 61
     $source = array();
62 62
 
63 63
     $major = $data['info']['major'];
64
-    if ($major==1 || $major==2 || (($major==3 || $major==4) && isset($speech['speaker']['house'])) || $major==101 || $major==6) {
64
+    if ($major == 1 || $major == 2 || (($major == 3 || $major == 4) && isset($speech['speaker']['house'])) || $major == 101 || $major == 6) {
65 65
         $source['title'] = 'Citation: ';
66
-        if ($major==1 || $major==2) {
66
+        if ($major == 1 || $major == 2) {
67 67
             $source['title'] .= 'HC';
68
-        } elseif ($major==3 || $major==4) {
69
-            if ($speech['speaker']['house']==1) {
68
+        } elseif ($major == 3 || $major == 4) {
69
+            if ($speech['speaker']['house'] == 1) {
70 70
                 $source['title'] .= 'HC';
71 71
             } else {
72 72
                 $source['title'] .= 'HL';
73 73
             }
74
-        } elseif ($major==6) {
74
+        } elseif ($major == 6) {
75 75
             $source['title'] .= $data['section_title'];
76 76
         } else {
77 77
             $source['title'] .= 'HL';
78 78
         }
79 79
         $source['title'] .= ' Deb, ' . format_date($data['info']['date'], LONGDATEFORMAT) . ', c' . $speech['colnum'];
80
-        if ($major==2) {
80
+        if ($major == 2) {
81 81
             $source['title'] .= 'WH';
82
-        } elseif ($major==3) {
82
+        } elseif ($major == 3) {
83 83
             $source['title'] .= 'W';
84
-        } elseif ($major==4) {
84
+        } elseif ($major == 4) {
85 85
             $source['title'] .= 'WS';
86 86
         }
87 87
     }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             <div class="debate-speech__speaker-and-content">
111 111
             <?php } ?>
112 112
 
113
-          <?php if(isset($speech['speaker']) && count($speech['speaker']) > 0) { ?>
113
+          <?php if (isset($speech['speaker']) && count($speech['speaker']) > 0) { ?>
114 114
             <h2 class="debate-speech__speaker">
115 115
                 <?php
116 116
 
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
                 <?php if ($division['has_description']) { ?>
178 178
                 <div class="debate-speech__division__details">
179 179
                     <span class="policy-vote__text">
180
-                        <?php include( dirname(__FILE__) . '/../divisions/_vote_description.php'); ?>
180
+                        <?php include(dirname(__FILE__) . '/../divisions/_vote_description.php'); ?>
181 181
                     </span><br>
182 182
                 </div>
183 183
                 <?php } ?>
184 184
 
185 185
               <?php if (isset($speech['mp_vote'])) {
186
-                $mp_vote = array( 'vote' => $speech['mp_vote']['vote'] );
186
+                $mp_vote = array('vote' => $speech['mp_vote']['vote']);
187 187
                 $before_mp = isset($speech['before_mp']);
188 188
                 $after_mp = isset($speech['after_mp']);
189 189
                 include dirname(__FILE__) . '/../divisions/_your_mp.php';
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             <div class="debate-speech__content"><?=$body ?></div>
196 196
             <?php } ?>
197 197
 
198
-            <?php if ( $section ) {
198
+            <?php if ($section) {
199 199
                 if ($speech['voting_data']) { ?>
200 200
 
201 201
                 <div class="debate-speech__question-answered">
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 
221 221
                 // Video
222 222
                 if ($data['info']['major'] == 1 && !$individual_item) { # Commons debates only
223
-                    if ($speech['video_status']&4) { ?>
223
+                    if ($speech['video_status'] & 4) { ?>
224 224
                         <a href="<?= $speech['commentsurl'] ?>" class="watch debate-speech__meta__link" onclick="return moveVideo(\'debate/'<?= $speech['gid'] ?>\');">Watch this</a>
225 225
                     <?php
226
-                    } elseif (!$speech['video'] && $speech['video_status']&1 && !($speech['video_status']&8)) {
226
+                    } elseif (!$speech['video'] && $speech['video_status'] & 1 && !($speech['video_status'] & 8)) {
227 227
                         $gid_type = $data['info']['major'] == 1 ? 'debate' : 'lords'; ?>
228 228
                         <a href="/video/?from=debate&amp;gid=<?= $gid_type ?>/<?= $speech['gid'] ?>" class="timestamp debate-speech__meta__link">Video match this</a>
229 229
                     <?php
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                     $moreinfo[] = $row['totalcomments'] . " $plural";
351 351
                 }
352 352
                 if (count($moreinfo) > 0) {
353
-                    print "<small>(" . implode (', ', $moreinfo) . ") </small>";
353
+                    print "<small>(" . implode(', ', $moreinfo) . ") </small>";
354 354
                 }
355 355
             } else {
356 356
                 // Nothing in this item, so no link.
Please login to merge, or discard this patch.
classes/Utility/House.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,28 +46,28 @@
 block discarded – undo
46 46
 
47 47
     public static function getCountryDetails($house) {
48 48
         $details = array(
49
-            HOUSE_TYPE_COMMONS => array (
49
+            HOUSE_TYPE_COMMONS => array(
50 50
                 'country' => 'UK',
51 51
                 'assembly' => 'uk-commons',
52 52
                 'location' => '&ndash; in the House of Commons',
53 53
                 'cons_type' => 'WMC',
54 54
                 'assembly_name' => 'House of Commons',
55 55
             ),
56
-            HOUSE_TYPE_NI => array (
56
+            HOUSE_TYPE_NI => array(
57 57
                 'country' => 'NORTHERN IRELAND',
58 58
                 'assembly' => 'ni',
59 59
                 'location' => '&ndash; in the Northern Ireland Assembly',
60 60
                 'cons_type' => 'NIE',
61 61
                 'assembly_name' => 'Northern Ireland Assembly',
62 62
             ),
63
-            HOUSE_TYPE_SCOTLAND => array (
63
+            HOUSE_TYPE_SCOTLAND => array(
64 64
                 'country' => 'SCOTLAND',
65 65
                 'assembly' => 'scotland',
66 66
                 'location' => '&ndash; in the Scottish Parliament',
67 67
                 'cons_type' => 'SPC',
68 68
                 'assembly_name' => 'Scottish Parliament',
69 69
             ),
70
-            HOUSE_TYPE_LORDS => array (
70
+            HOUSE_TYPE_LORDS => array(
71 71
                 'country' => 'UK',
72 72
                 'assembly' => 'uk-lords',
73 73
                 'location' => '&ndash; in the House of Lords',
Please login to merge, or discard this patch.
tests/DivisionsTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
     }
18 18
 
19 19
     private function fetch_division_page() {
20
-        return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) );
20
+        return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions'));
21 21
     }
22 22
 
23 23
     private function fetch_mp_recent_page()
24 24
     {
25
-        $vars = array( 'pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent' );
25
+        $vars = array('pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent');
26 26
         return $this->base_fetch_page($vars, 'mp', 'index.php', '/mp/recent.php');
27 27
     }
28 28
 
29 29
     private function fetch_recent_page() {
30
-        return $this->base_fetch_page( array('url' => '/divisions' ), 'divisions', 'index.php', '/divisions/index.php' );
30
+        return $this->base_fetch_page(array('url' => '/divisions'), 'divisions', 'index.php', '/divisions/index.php');
31 31
     }
32 32
 
33 33
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     }
114 114
 
115 115
     public function testNotEnoughInfoStatement() {
116
-        return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) );
116
+        return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions'));
117 117
         $this->assertContains('we don&rsquo;t have enough information to calculate Test Current-MP&rsquo;s position', $page);
118 118
     }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
     public function testSingleDivision() {
127
-        $page = $this->base_fetch_page( array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons' ), 'divisions', 'division.php', '/divisions/division.php' );
127
+        $page = $this->base_fetch_page(array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons'), 'divisions', 'division.php', '/divisions/division.php');
128 128
         $this->assertContains('A majority of MPs  <b>voted in favour</b> of a thing', $page);
129 129
         $this->assertContains('Aye: 2', $page);
130 130
         $this->assertContains('No: 0', $page);
Please login to merge, or discard this patch.