Passed
Push — master ( ad0ec6...39c00e )
by Matthew
06:23 queued 02:14
created
www/includes/easyparliament/templates/html/user/view_user.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
                 <div class="row">
10 10
                 <span class="label"><?= gettext('Website') ?></span>
11
-                <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span>
11
+                <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span>
12 12
                 </div>
13 13
 
14 14
                 <div class="row">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/user/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
           <div class="row">
39 39
             <span class="label"><?= gettext('Website') ?></span>
40
-            <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span>
40
+            <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span>
41 41
           </div>
42 42
 
43 43
           <?php if ($facebook_user) { ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/profile.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,11 +217,14 @@
 block discarded – undo
217 217
                         <?= $recent_appearances['additional_links'] ?>
218 218
                         <?php endif; ?>
219 219
 
220
-                    <?php else: ?>
220
+                    <?php else {
221
+    : ?>
221 222
 
222 223
                         <p><?=gettext('No recent appearances to display.') ?></p>
223 224
 
224
-                    <?php endif; ?>
225
+                    <?php endif;
226
+}
227
+?>
225 228
 
226 229
                 </div>
227 230
                 <?php endif; ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_vote_summary.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <p>
2 2
     <a href="#for"><?= sprintf(gettext('%s for'), $division['for']) ?></a>,
3 3
     <a href="#against"><?= sprintf(gettext('%s against'), $division['against']) ?></a><?php
4
-  if ($division['both'] > 0) { ?>,
4
+    if ($division['both'] > 0) { ?>,
5 5
     <a href="#both"><?= sprintf(gettext('%s abstained'), $division['both']) ?></a><?php
6
-  }
7
-  if ($division['absent'] > 0) { ?>,
6
+    }
7
+    if ($division['absent'] > 0) { ?>,
8 8
     <a href="#absent"><?= sprintf(gettext('%s absent'), $division['absent']) ?></a><?php
9
-  } ?>.
9
+    } ?>.
10 10
 </p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/divisions/_name_vote_list.php 2 patches
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%s</span></li>',
7 7
       $vote['person_id'],
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     <?php if (count($tellers) > 0) { ?>
29 29
       <h4><?= gettext('Tellers') ?></h4>
30 30
       <ul class="division-names">
31
-        <?php foreach($tellers as $teller) {
31
+        <?php foreach ($tellers as $teller) {
32 32
           print_voter($teller);
33 33
         } ?>
34 34
       </p>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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
-      '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s%s</span></li>',
7
-      $vote['person_id'],
8
-      $vote['name'],
9
-      gettext($vote['party']),
10
-      $vote['proxy'] ? " (proxy vote cast by $vote[proxy])" : ''
6
+        '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s%s</span></li>',
7
+        $vote['person_id'],
8
+        $vote['name'],
9
+        gettext($vote['party']),
10
+        $vote['proxy'] ? " (proxy vote cast by $vote[proxy])" : ''
11 11
     );
12
-  }
12
+    }
13 13
 }
14 14
 
15 15
 if (count($votes) > 0) { ?>
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
       <?php $tellers = array(); ?>
19 19
       <ul class="division-names js-vote-accordion" data-show-all="<?= gettext('Show All') ?>">
20 20
         <?php foreach ($votes as $vote) {
21
-          if ($vote['teller']) {
22
-              $tellers[] = $vote;
23
-          } else {
21
+            if ($vote['teller']) {
22
+                $tellers[] = $vote;
23
+            } else {
24 24
             print_voter($vote);
25
-          }
25
+            }
26 26
         } ?>
27 27
       </ul>
28 28
     <?php if (count($tellers) > 0) { ?>
29 29
       <h4><?= gettext('Tellers') ?></h4>
30 30
       <ul class="division-names">
31 31
         <?php foreach($tellers as $teller) {
32
-          print_voter($teller);
32
+            print_voter($teller);
33 33
         } ?>
34 34
       </p>
35 35
     <?php } ?>
Please login to merge, or discard this patch.
classes/AlertView/Standard.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 try {
181 181
                     $MEMBER = new \MEMBER(array('constituency'=>$constituency, 'house' => 1));
182 182
                     $cons[$constituency] = $MEMBER;
183
-                } catch ( \MySociety\TheyWorkForYou\MemberException $e ) {
183
+                } catch (\MySociety\TheyWorkForYou\MemberException $e) {
184 184
                     // do nothing
185 185
                 }
186 186
             }
@@ -200,17 +200,17 @@  discard block
 block discarded – undo
200 200
 
201 201
         // If this goes well, the alert will be added to the database and a confirmation email
202 202
         // will be sent to them.
203
-        $success = $this->alert->add( $this->data, $confirm );
203
+        $success = $this->alert->add($this->data, $confirm);
204 204
 
205
-        if ($success>0 && !$confirm) {
205
+        if ($success > 0 && !$confirm) {
206 206
             $result = 'alert-added';
207
-        } elseif ($success>0) {
207
+        } elseif ($success > 0) {
208 208
             $result = 'alert-confirmation';
209 209
         } elseif ($success == -2) {
210 210
             // we need to make sure we know that the person attempting to sign up
211 211
             // for the alert has that email address to stop people trying to work
212 212
             // out what alerts they are signed up to
213
-            if ( $this->data['email_verified'] || ( $this->user->loggedin && $this->user->email() == $this->data['email'] ) ) {
213
+            if ($this->data['email_verified'] || ($this->user->loggedin && $this->user->email() == $this->data['email'])) {
214 214
                 $result = 'alert-exists';
215 215
             } else {
216 216
                 // don't throw an error message as that implies that they have already signed
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
 
237 237
     private function formatSearchTerms() {
238
-        if ( $this->data['alertsearch'] ) {
238
+        if ($this->data['alertsearch']) {
239 239
             $this->data['alertsearch_pretty'] = \MySociety\TheyWorkForYou\Utility\Alert::prettifyCriteria($this->data['alertsearch']);
240 240
             $this->data['search_text'] = $this->data['alertsearch'];
241 241
         } else {
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
     }
263 263
 
264 264
     private function formatSearchMemberData() {
265
-        if ( isset($this->data['postcode']) ) {
265
+        if (isset($this->data['postcode'])) {
266 266
             try {
267 267
                 $postcode = $this->data['postcode'];
268 268
 
269
-                $MEMBER = new \MEMBER( array('postcode' => $postcode) );
269
+                $MEMBER = new \MEMBER(array('postcode' => $postcode));
270 270
                 // move the postcode to the front just to be tidy
271 271
                 $tidy_alertsearch = $postcode . " " . trim(str_replace("$postcode", "", $this->data['alertsearch']));
272 272
                 $alertsearch_display = str_replace("$postcode ", "", $tidy_alertsearch);
@@ -275,29 +275,29 @@  discard block
 block discarded – undo
275 275
                 $this->data['member_displaysearch'] = $alertsearch_display;
276 276
                 $this->data['member'] = $MEMBER;
277 277
 
278
-                if ( isset($this->data['mistakes']['postcode_and']) ) {
278
+                if (isset($this->data['mistakes']['postcode_and'])) {
279 279
                     $constituencies = \MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituencies($postcode);
280
-                    if ( isset($constituencies['SPC']) ) {
280
+                    if (isset($constituencies['SPC'])) {
281 281
                         $MEMBER = new \MEMBER(array('constituency' => $constituencies['SPC'], 'house' => HOUSE_TYPE_SCOTLAND));
282 282
                         $this->data['scottish_alertsearch'] = str_replace("$postcode", "speaker:" . $MEMBER->person_id, $tidy_alertsearch);
283 283
                         $this->data['scottish_member'] = $MEMBER;
284
-                    } elseif ( isset($constituencies['WAC']) ) {
284
+                    } elseif (isset($constituencies['WAC'])) {
285 285
                         $MEMBER = new \MEMBER(array('constituency' => $constituencies['WAC'], 'house' => HOUSE_TYPE_WALES));
286 286
                         $this->data['welsh_alertsearch'] = str_replace("$postcode", "speaker:" . $MEMBER->person_id, $tidy_alertsearch);
287 287
                         $this->data['welsh_member'] = $MEMBER;
288 288
                     }
289 289
                 }
290
-            } catch ( \MySociety\TheyWorkForYou\MemberException $e ) {
290
+            } catch (\MySociety\TheyWorkForYou\MemberException $e) {
291 291
                 $this->data['member_error'] = 1;
292 292
             }
293 293
         }
294 294
 
295
-        if ( $this->data['pid'] ) {
296
-            $MEMBER = new \MEMBER( array('person_id' => $this->data['pid']) );
295
+        if ($this->data['pid']) {
296
+            $MEMBER = new \MEMBER(array('person_id' => $this->data['pid']));
297 297
             $this->data['pid_member'] = $MEMBER;
298 298
         }
299 299
 
300
-        if ( $this->data['keyword'] ) {
300
+        if ($this->data['keyword']) {
301 301
             $this->data['display_keyword'] = \MySociety\TheyWorkForYou\Utility\Alert::prettifyCriteria($this->data['keyword']);
302 302
         }
303 303
     }
Please login to merge, or discard this patch.
classes/SectionView/SeneddView.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected function getSearchSections() {
42 42
         return array(
43
-            array( 'section' => 'wales' )
43
+            array('section' => 'wales')
44 44
         );
45 45
     }
46 46
 
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
 
60 60
         $debates = $DEBATELIST->display('recent_debates', array('days' => 30, 'num' => 6), 'none');
61 61
         $MOREURL = new \MySociety\TheyWorkForYou\Url('senedddebatesfront');
62
-        $MOREURL->insert( array( 'more' => 1 ) );
62
+        $MOREURL->insert(array('more' => 1));
63 63
 
64 64
         // this makes sure that we don't repeat this debate in the list below
65 65
         $random_debate = null;
66
-        if ( isset($debates['data']) && count($debates['data']) ) {
66
+        if (isset($debates['data']) && count($debates['data'])) {
67 67
             $random_debate = $debates['data'][0];
68 68
         }
69 69
 
70 70
         $recent = array();
71
-        if ( isset($debates['data']) && count($debates['data']) ) {
71
+        if (isset($debates['data']) && count($debates['data'])) {
72 72
             // at the start of a session there may be less than 6
73 73
             // debates
74 74
             $max = 6;
75
-            if ( count($debates['data']) < 6 ) {
75
+            if (count($debates['data']) < 6) {
76 76
                 $max = count($debates['data']);
77 77
             }
78
-            for ( $i = 1; $i < $max; $i++ ) {
78
+            for ($i = 1; $i < $max; $i++) {
79 79
                 $debate = $debates['data'][$i];
80 80
                 $debate['desc'] = "Senedd";
81 81
                 $debate['more_url'] = $MOREURL->generate();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         }
85 85
 
86 86
         $featured = array();
87
-        if ( $random_debate ) {
87
+        if ($random_debate) {
88 88
             $featured = $random_debate;
89 89
             $featured['more_url'] = $MOREURL->generate();
90 90
             $featured['desc'] = 'Senedd';
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
 
95 95
         $data['featured'] = $featured;
96
-        $data['debates'] = array( 'recent' => $recent);
96
+        $data['debates'] = array('recent' => $recent);
97 97
 
98 98
         $data['regional'] = $this->getMSList();
99 99
         $data['template'] = 'senedd/index';
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/votes.php 3 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,13 +146,16 @@
 block discarded – undo
146 146
 
147 147
                         <?php endif; ?>
148 148
 
149
-                    <?php else: ?>
149
+                    <?php else {
150
+    : ?>
150 151
 
151 152
                         <div class="panel">
152 153
                             <p>This person has not voted on any of the key issues which we keep track of.</p>
153 154
                         </div>
154 155
 
155
-                    <?php endif; ?>
156
+                    <?php endif;
157
+}
158
+?>
156 159
 
157 160
                 <?php endif; ?>
158 161
                 <?php include('_covid19_panel.php'); ?>
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
                         include '_vote_description.php';
117 117
 
118
-                      } ?>
118
+                        } ?>
119 119
                     </ul>
120 120
 
121 121
                     <?php } ?>
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                                 $policy_group = $segment['key'];
157 157
 
158 158
                                 if (isset($policy_last_update[$policy_id]) && $policy_last_update[$policy_id] > $most_recent) {
159
-                                  $most_recent = $policy_last_update[$policy_id];
159
+                                    $most_recent = $policy_last_update[$policy_id];
160 160
                                 }
161 161
 
162 162
                                 if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
                                 include '_vote_description.php';
200 200
 
201
-                              } ?>
201
+                                } ?>
202 202
                             </ul>
203 203
 
204 204
                             <div class="share-vote-descriptions">
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                         $policy_direction = $key_vote["person_position"];
95 95
                         $policy_group = "highlighted";
96 96
                         $party_score_difference = $key_vote["score_difference"];
97
-                        $party_position = $key_vote['party_position'] ;
97
+                        $party_position = $key_vote['party_position'];
98 98
                         $comparison_party = $data["comparison_party"];
99 99
                         $current_party_comparison = $data["current_party_comparison"];
100 100
                         $unslugified_comparison_party = ucwords(str_replace('-', ' ', $comparison_party));
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                                   $most_recent = $policy_last_update[$policy_id];
160 160
                                 }
161 161
 
162
-                                if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) {
162
+                                if ($key_vote['has_strong'] || $key_vote['position'] == 'has never voted on') {
163 163
                                     $description = ucfirst($key_vote['desc']);
164 164
                                 } else {
165 165
                                     $description = sprintf(
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                                     $party_position = $diff['party_position'];
189 189
                                     $party_score_difference = $diff["score_difference"];
190 190
                                     if ($sorted_diffs[$policy_id]['score_difference'] > $min_diff_score && $party_member_count > 1) {
191
-                                        $party_voting_line = sprintf( 'Comparable %s MPs %s.', $unslugified_comparison_party, $diff['party_position']);
191
+                                        $party_voting_line = sprintf('Comparable %s MPs %s.', $unslugified_comparison_party, $diff['party_position']);
192 192
                                     }
193 193
                                 } else {
194 194
                                     $party_voting_line = null;
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/scotland/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 <div class="row nested-row">
59 59
                     <div class="homepage-featured-content homepage-content-section">
60 60
                         <?php if ( $featured ) {
61
-                             include dirname(__FILE__) . "/../homepage/featured.php";
61
+                                include dirname(__FILE__) . "/../homepage/featured.php";
62 62
                         } ?>
63 63
                     </div>
64 64
                     <div class="homepage-create-alert homepage-content-section">
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
                 </div>
12 12
                 <div class="row">
13 13
                     <div class="medium-9 columns">
14
-                    <?php if ( count($data['regional']) > 0 ) { ?>
14
+                    <?php if (count($data['regional']) > 0) { ?>
15 15
                         <ul class="homepage-rep-list">
16 16
                         <li>Your Regional MSPs:</li>
17
-                        <?php foreach ( $data['regional'] as $msp ) { ?>
17
+                        <?php foreach ($data['regional'] as $msp) { ?>
18 18
                             <li class="homepage-rep-list__rep"><a href="/msp/?p=<?= $msp['person_id'] ?>"><?= $msp['name'] ?></a></li>
19 19
                         <?php } ?>
20 20
                         </ul>
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             <div class="panel panel--flushtop clearfix">
58 58
                 <div class="row nested-row">
59 59
                     <div class="homepage-featured-content homepage-content-section">
60
-                        <?php if ( $featured ) {
60
+                        <?php if ($featured) {
61 61
                              include dirname(__FILE__) . "/../homepage/featured.php";
62 62
                         } ?>
63 63
                     </div>
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
                         <h2>Recently in Parliament</h2>
106 106
                         <ul class="recently__list"><?php
107
-                            foreach ( $debates['recent'] as $recent ) {
107
+                            foreach ($debates['recent'] as $recent) {
108 108
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
109 109
                             }
110 110
                         ?></ul>
Please login to merge, or discard this patch.