Passed
Push — master ( a38590...890bf3 )
by Matthew
04:30
created
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.
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   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
             <div class="panel panel--flushtop clearfix">
19 19
                 <div class="row nested-row">
20 20
                     <div class="homepage-featured-content homepage-content-section">
21
-                        <?php if ( $featured ) {
21
+                        <?php if ($featured) {
22 22
                              include dirname(__FILE__) . "/../homepage/featured.php";
23 23
                         } ?>
24 24
                     </div>
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
                         <h2>Recently in Parliament</h2>
39 39
                         <ul class="recently__list"><?php
40
-                            foreach ( $debates['recent'] as $recent ) {
40
+                            foreach ($debates['recent'] as $recent) {
41 41
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
42 42
                             }
43 43
                         ?></ul>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/london/index.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
             <div class="hero__mp-search__wrap">
5 5
                 <h1>Find out more about your AMs</h1>
6 6
                 <div class="row collapse">
7
-                    <?php if ( count($data['regional']) > 0 ) { ?>
7
+                    <?php if (count($data['regional']) > 0) { ?>
8 8
                         <ul class="homepage-rep-list">
9 9
                             <li>Your Assembly Memberss: </li>
10
-                        <?php foreach ( $data['regional'] as $member ) { ?>
10
+                        <?php foreach ($data['regional'] as $member) { ?>
11 11
                             <li class="homepage-rep-list__rep"><a href="/london-assembly-member/?p=<?= $member['person_id'] ?>"><?= $member['name'] ?></a></li>
12 12
                         <?php } ?>
13 13
                         </ul>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             <div class="panel panel--flushtop clearfix">
41 41
                 <div class="row nested-row">
42 42
                     <div class="homepage-featured-content homepage-content-section">
43
-                        <?php if ( $featured ) {
43
+                        <?php if ($featured) {
44 44
                              include dirname(__FILE__) . "/../homepage/featured.php";
45 45
                         } ?>
46 46
                     </div>
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                     <div class="homepage-recently homepage-content-section">
86 86
                         <h2>Recently answered questions to the Mayor of London</h2>
87 87
                         <ul class="recently__list"><?php
88
-                            foreach ( $debates['recent'] as $recent ) {
88
+                            foreach ($debates['recent'] as $recent) {
89 89
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
90 90
                             }
91 91
                         ?></ul>
Please login to merge, or discard this patch.
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.
www/includes/easyparliament/templates/html/header.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     <meta property="og:site_name" content="TheyWorkForYou">
21 21
     <meta property="og:url" content="<?= _htmlentities($page_url) ?>">
22
-    <meta property="og:title" content="<?= strip_tags( $og_title ?: $page_title ) ?>">
22
+    <meta property="og:title" content="<?= strip_tags($og_title ?: $page_title) ?>">
23 23
     <meta property="og:type" content="website">
24 24
 
25 25
     <meta name="twitter:card" content="summary_large_image">
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
                 <div class="site-nav__user">
147 147
                     <ul>
148
-                      <?php foreach ($user_nav_links as $nav_link){ ?>
148
+                      <?php foreach ($user_nav_links as $nav_link) { ?>
149 149
                         <li><a href="<?= $nav_link['href']; ?>" title="<?= $nav_link['title']; ?>" class="<?= $nav_link['classes']; ?>">
150 150
                             <?= $nav_link['text'] ?>
151 151
                         </a></li>
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         </div>
176 176
     </nav>
177 177
 
178
-    <?php if (isset($random_banner) && $random_banner ) { ?>
178
+    <?php if (isset($random_banner) && $random_banner) { ?>
179 179
       <div class="banner">
180 180
           <div class="full-page__row">
181 181
               <div class="banner__content">
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     <div class="full-page legacy-page static-page">
191 191
         <div class="full-page__row">
192 192
             <div class="panel">
193
-            <?php foreach ( $page_errors as $error ) { ?>
193
+            <?php foreach ($page_errors as $error) { ?>
194 194
                 <p><?= $error['text'] ?></p>
195 195
             <?php } ?>
196 196
             </div>
Please login to merge, or discard this patch.
www/docs/admin/banner.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
         $out .= '<p><label for="banner">JSON input for announcements and sidebars.<br>';
74 74
         $out .= '<span><a href="https://gist.github.com/ajparsons/ff8029afd333122775864b58fbe29433">See example of format</a>, <a href="https://jsonformatter.curiousconcept.com/">Link to online JSON validator</a></span><br>';
75 75
     };
76
-     $out .= '<textarea id="banner_text" name="banner" rows="30" cols="80">' . htmlentities($text) . "</textarea></p>\n";
76
+        $out .= '<textarea id="banner_text" name="banner" rows="30" cols="80">' . htmlentities($text) . "</textarea></p>\n";
77 77
     $out .= '<span class="formw"><input name="btnaction" type="submit" value="Save"></span>';
78 78
     $out .= '</form>';
79 79
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     $editorial_option = get_http_var('editorial_option');
15 15
 }
16 16
 
17
-if ($editorial_option == "banner"){
17
+if ($editorial_option == "banner") {
18 18
     $this_page = 'admin_banner';
19 19
 } elseif ($editorial_option == "announcements") {
20 20
     $this_page = 'admin_announcement';
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     global $editorial_option;
86 86
     $banner_text = get_http_var('banner');
87 87
     
88
-    if ( $banner->set_json($banner_text, $editorial_option) ) {
88
+    if ($banner->set_json($banner_text, $editorial_option)) {
89 89
         $out = "<h4>update successful</h4>";
90 90
         $out .= "<p>Json is now:</p><p>$banner_text</p>";
91 91
     } else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     $editorial_option = get_http_var('editorial_option');
15 15
 }
16 16
 
17
-if ($editorial_option == "banner"){
17
+if ($editorial_option == "banner") {
18 18
     $this_page = 'admin_banner';
19 19
 } elseif ($editorial_option == "announcements") {
20 20
     $this_page = 'admin_announcement';
Please login to merge, or discard this patch.