Failed Conditions
Pull Request — master (#1851)
by Struan
04:38
created
www/includes/easyparliament/templates/html/homepage/devolved-list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-$nav_items =  [
2
+$nav_items = [
3 3
     ['hansard', 'alldebatesfront', 'mps', 'peers', 'interests_home', 'wranswmsfront', 'divisions_recent_commons', 'divisions_recent_lords'],
4
-    ['sp_home', 'sp_home', 'spdebatesfront', 'msps',  'spwransfront', 'divisions_recent_sp'],
4
+    ['sp_home', 'sp_home', 'spdebatesfront', 'msps', 'spwransfront', 'divisions_recent_sp'],
5 5
     ['wales_home', 'wales_home', 'wales_debates', 'mss', 'welshlanguage', 'divisions_recent_wales'],
6 6
     ['ni_home', 'ni_home', 'nioverview', 'mlas'],
7 7
 ];
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/interests/_register_field.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,12 +13,15 @@
 block discarded – undo
13 13
             <?php $detail = $upper_detail; ?>
14 14
         </ul>
15 15
         </li>
16
-    <?php else : ?>
16
+    <?php else {
17
+    : ?>
17 18
         <?php if ($detail->has_value()): ?>
18 19
         <li class="interest-detail">
19 20
             <span class="interest-detail-name"><?= $detail->display_as ?>: </span>
20 21
             <span class="interest-detail-value"><?= htmlspecialchars($detail->value) ?></span>
21 22
         </li>
22
-        <?php endif; ?>
23
+        <?php endif;
24
+}
25
+?>
23 26
 
24 27
     <?php endif; ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/interests/highlighted_2024.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
                                     <th>MP's comment</th>
54 54
                                 </tr>
55 55
                     <?php foreach ($register->persons as $person) { ?>
56
-                        <?php foreach($person->categories as $category) { ?>
56
+                        <?php foreach ($person->categories as $category) { ?>
57 57
                             <?php if ($category->category_id != $category_id) { ?>
58 58
                                 <?php continue; ?>
59 59
                             <?php }; ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/interests/_register_entry.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,9 +28,12 @@
 block discarded – undo
28 28
     <?php // This is a more mininal style of entry, don't use the header structure, just print the xml content?>
29 29
     <?php if ($entry->content_format == "xml") : ?>
30 30
         <?= $entry->content ?>
31
-    <?php else: ?>
31
+    <?php else {
32
+    : ?>
32 33
         <p class="interest-content"><?= htmlspecialchars($entry->content) ?></p>
33
-    <?php endif; ?>
34
+    <?php endif;
35
+}
36
+?>
34 37
 <?php endif; ?>
35 38
 
36 39
     </ul>
Please login to merge, or discard this patch.
classes/Renderer/Header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
         if ($nextprev) {
171 171
             // Four different kinds of back/forth links we might build.
172
-            $links =  ["first", "prev", "up", "next", "last"];
172
+            $links = ["first", "prev", "up", "next", "last"];
173 173
 
174 174
             foreach ($links as $type) {
175 175
                 if ($link = $this->generate_next_prev_link($nextprev, $type)) {
@@ -307,9 +307,9 @@  discard block
 block discarded – undo
307 307
         // Page names mapping to those in metadata.php.
308 308
         // Links in the top menu, and the sublinks we see if
309 309
         // we're within that section.
310
-        $nav_items =  [
310
+        $nav_items = [
311 311
             ['home'],
312
-            ['hansard', 'mps', 'peers', 'alldebatesfront', 'interests_home', 'wranswmsfront', 'pbc_front', 'divisions_recent_commons', 'divisions_recent_lords',  'calendar_summary'],
312
+            ['hansard', 'mps', 'peers', 'alldebatesfront', 'interests_home', 'wranswmsfront', 'pbc_front', 'divisions_recent_commons', 'divisions_recent_lords', 'calendar_summary'],
313 313
             ['sp_home', 'spoverview', 'msps', 'spdebatesfront', 'divisions_recent_sp'], #'spwransfront'
314 314
             ['ni_home', 'nioverview', 'mlas'],
315 315
             ['wales_home', 'seneddoverview', 'mss', 'wales_debates', 'divisions_recent_wales'],
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/alert/_alert_form.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,10 +137,10 @@
 block discarded – undo
137 137
                   <h3><?= gettext('Current keywords in this alert:') ?></h3>
138 138
                     <ul class="keyword-list">
139 139
                       <?php foreach ($keywords as $word) {
140
-                          if (!in_array($word, $skip_keyword_terms)) { ?>
140
+                            if (!in_array($word, $skip_keyword_terms)) { ?>
141 141
                           <li class="keyword-list__tag keyword-list__tag--included"><?= _htmlspecialchars($word) ?>
142 142
                       <?php }
143
-                          } ?>
143
+                            } ?>
144 144
                     </ul>
145 145
                   </div>
146 146
 
Please login to merge, or discard this patch.
www/includes/easyparliament/alert.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public $token_checked = null;
41 41
     private $alert_id = "";
42 42
     public $email = "";
43
-    public $criteria = "";		// Sets the terms that are used to produce the search results.
43
+    public $criteria = ""; // Sets the terms that are used to produce the search results.
44 44
     public $ignore_speaker_votes = 0;
45 45
 
46 46
     private $db;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $contents = ['criteria' => $row['criteria'], 'count' => $row['cnt']];
73 73
             $data[] = $contents;
74 74
         }
75
-        $data =  ['alerts' => $data];
75
+        $data = ['alerts' => $data];
76 76
         return $data;
77 77
     }
78 78
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         $data = $q->fetchAll();
103 103
         $info = "Alert";
104
-        $data =  ['info' => $info, 'data' => $data];
104
+        $data = ['info' => $info, 'data' => $data];
105 105
 
106 106
         return $data;
107 107
     }
@@ -300,12 +300,12 @@  discard block
 block discarded – undo
300 300
         }
301 301
 
302 302
         // Arrays we need to send a templated email.
303
-        $data =  [
303
+        $data = [
304 304
             'to' 		=> $details['email'],
305 305
             'template' 	=> 'alert_confirmation',
306 306
         ];
307 307
 
308
-        $merge =  [
308
+        $merge = [
309 309
             'CONFIRMURL'	=> $confirmurl,
310 310
             'CRITERIA'	=> $this->criteria_pretty(),
311 311
         ];
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     }
320 320
 
321 321
     public function send_already_signedup_email($details) {
322
-        $data =  [
322
+        $data = [
323 323
             'to' 		=> $details['email'],
324 324
             'template' 	=> 'alert_already_signedup',
325 325
         ];
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         $criteria = \MySociety\TheyWorkForYou\Utility\Alert::detailsToCriteria($details);
328 328
         $this->criteria = $criteria;
329 329
 
330
-        $merge =  [
330
+        $merge = [
331 331
             'CRITERIA'	=> $this->criteria_pretty(),
332 332
         ];
333 333
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/alert/index.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
           </div>
130 130
       <?php } elseif ($step !== '') { ?>
131 131
         <?php include '_alert_form.php';
132
-      } elseif ($this_step == '') {
133
-          if(
134
-              !$results && (
135
-                  $members ||
132
+        } elseif ($this_step == '') {
133
+            if(
134
+                !$results && (
135
+                    $members ||
136 136
                 (isset($constituencies) && count($constituencies) > 0) ||
137 137
                 ($alertsearch)
138
-              )
139
-          ) {
140
-              /* We need to disambiguate the user's instructions */
141
-              $member_options = false;
142
-              ?>
138
+                )
139
+            ) {
140
+                /* We need to disambiguate the user's instructions */
141
+                $member_options = false;
142
+                ?>
143 143
         <div class="alert-section alert-section--disambiguation">
144 144
             <div class="alert-section__primary">
145 145
 
146 146
               <?php if ($members) {
147
-                  $member_options = true; ?>
147
+                    $member_options = true; ?>
148 148
                 <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3>
149 149
                 <ul>
150 150
                   <?php
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                             <input type="hidden" name="pid" value="<?= $row['person_id'] ?>">
158 158
                             <input type="hidden" name="ignore_speaker_votes" value="<?= $ignore_speaker_votes ?>">
159 159
                             <?php
160
-                                  $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']);
160
+                                    $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']);
161 161
                         if ($row['constituency']) {
162 162
                             $name .= ' (' . gettext($row['constituency']) . ')';
163 163
                         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
               <?php } ?>
172 172
 
173 173
               <?php if (isset($constituencies) && count($constituencies) > 0) {
174
-                  $member_options = true; ?>
174
+                    $member_options = true; ?>
175 175
                 <h3><?= sprintf(gettext('Sign up for alerts when MPs for constituencies matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3>
176 176
                 <ul>
177 177
                 <?php foreach ($constituencies as $constituency => $member) { ?>
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
               <?php } ?>
190 190
 
191 191
               <?php if ($alertsearch) {
192
-                  if (!$member_options) { ?>
192
+                    if (!$member_options) { ?>
193 193
                 <h3><?= gettext('That doesn’t match a person, postcode or constituency. Search again to refine your email alert.') ?></h3>
194 194
                 <ul>
195 195
                     <?php if (isset($mistakes['postcode_and'])) { ?>
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
                             want? You will only get an alert if all of these
201 201
                             are mentioned in the same debate.') ?>
202 202
                           <?php if (isset($member_alertsearch)) {
203
-                              printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…'));
204
-                          } ?>
203
+                                printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…'));
204
+                            } ?>
205 205
                         </em>
206 206
                     </li>
207 207
                     <?php } ?>
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
       <?php } elseif ($step !== '') { ?>
131 131
         <?php include '_alert_form.php';
132 132
       } elseif ($this_step == '') {
133
-          if(
133
+          if (
134 134
               !$results && (
135 135
                   $members ||
136 136
                 (isset($constituencies) && count($constituencies) > 0) ||
Please login to merge, or discard this patch.
classes/Utility/Search.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             }
114 114
         }
115 115
 
116
-        uasort($speakers, function ($a, $b) {
116
+        uasort($speakers, function($a, $b) {
117 117
 
118 118
             if ($a['count'] > $b['count']) {
119 119
                 return -1;
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
             if ($mp_only) {
257 257
                 $constituency = Postcode::postcodeToConstituency($searchterm);
258 258
                 if ($constituency) {
259
-                    return [ [$constituency], true ];
259
+                    return [[$constituency], true];
260 260
                 }
261 261
             } else {
262 262
                 $constituencies = Postcode::postcodeToConstituencies($searchterm);
263 263
                 if ($constituencies) {
264
-                    return [ $constituencies, true ];
264
+                    return [$constituencies, true];
265 265
                 }
266 266
             }
267 267
         }
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             $constituencies[] = $row['name'];
281 281
         }
282 282
 
283
-        return [ $constituencies, false ];
283
+        return [$constituencies, false];
284 284
     }
285 285
 
286 286
     /**
Please login to merge, or discard this patch.