Passed
Pull Request — master (#1882)
by
unknown
05:02
created
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.
www/includes/easyparliament/templates/html/homepage/devolved-list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 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 4
     ['sp_home', 'sp_home', 'spdebatesfront', 'msps', 'interest_category_sp', 'spwransfront', 'divisions_recent_sp'],
5
-    ['wales_home', 'wales_home', 'wales_debates', 'mss','interest_category_wp', 'welshlanguage', 'divisions_recent_wales'],
6
-    ['ni_home', 'ni_home', 'nioverview', 'mlas','interest_category_ni'],
5
+    ['wales_home', 'wales_home', 'wales_debates', 'mss', 'interest_category_wp', 'welshlanguage', 'divisions_recent_wales'],
6
+    ['ni_home', 'ni_home', 'nioverview', 'mlas', 'interest_category_ni'],
7 7
 ];
8 8
 
9 9
 ?>  
Please login to merge, or discard this patch.
classes/DataClass/Regmem/CategoryList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
     public function limitToCategoryIds(array $categoryIds) {
18 18
         // Filter the categories to only include those with the given IDs
19
-        $this->items = array_filter($this->items, function ($category) use ($categoryIds) {
19
+        $this->items = array_filter($this->items, function($category) use ($categoryIds) {
20 20
             return in_array($category->category_id, $categoryIds);
21 21
         });
22 22
     }
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', 'interest_category_sp', 'spdebatesfront', 'divisions_recent_sp'], #'spwransfront'
314 314
             ['ni_home', 'nioverview', 'mlas', 'interest_category_ni'],
315 315
             ['wales_home', 'seneddoverview', 'mss', 'interest_category_wp', 'wales_debates', 'divisions_recent_wales'],
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/votes.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 
132 132
                     <ul class="vote-descriptions">
133 133
                               <?php foreach ($sig_diff_policy->policy_pairs as $policy_pair) {
134
-                                  include '_vote_description.php';
135
-                              } ?>
134
+                                    include '_vote_description.php';
135
+                                } ?>
136 136
                             </ul>
137 137
 
138 138
                     <?php } ?>
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
                             <ul class="vote-descriptions">
166 166
                               <?php foreach ($segment->policy_pairs as $policy_pair) {
167 167
 
168
-                                  include '_vote_description.php';
168
+                                    include '_vote_description.php';
169 169
 
170
-                              } ?>
170
+                                } ?>
171 171
                             </ul>
172 172
 
173 173
                             <p class="voting-information-provenance">
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
                 <h3 class="browse-content">Comparison periods</h3>
25 25
                     <ul> 
26
-                    <?php foreach($available_periods as $period) { ?>
26
+                    <?php foreach ($available_periods as $period) { ?>
27 27
                         <li><a href="?comparison_period=<?= $period->lslug() ?>" class="<?= $period->lslug() === $comparison_period->lslug() ? 'active-comparison-period' : '' ?>"><?= $period->description ?></a></li>
28 28
                     <?php } ?>
29 29
                     </ul>
Please login to merge, or discard this patch.
tests/DivisionsTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
     }
14 14
 
15 15
     private function fetch_mp_recent_page() {
16
-        $vars = [ 'pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent' ];
16
+        $vars = ['pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent'];
17 17
         return $this->base_fetch_page($vars, 'mp', 'index.php', '/mp/recent.php');
18 18
     }
19 19
 
20 20
     private function fetch_recent_page() {
21
-        return $this->base_fetch_page(['url' => '/divisions' ], 'divisions', 'index.php', '/divisions/index.php');
21
+        return $this->base_fetch_page(['url' => '/divisions'], 'divisions', 'index.php', '/divisions/index.php');
22 22
     }
23 23
 
24 24
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     }
55 55
 
56 56
     public function testSingleDivision() {
57
-        $page = $this->base_fetch_page(['url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons' ], 'divisions', 'division.php', '/divisions/division.php');
57
+        $page = $this->base_fetch_page(['url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons'], 'divisions', 'division.php', '/divisions/division.php');
58 58
         $this->assertStringContainsString('A majority of MPs  <b>voted in favour</b> of a thing', $page);
59 59
         $this->assertStringContainsString('Aye: 200', $page);
60 60
         $this->assertStringNotContainsString('No:', $page); # Summary 100, but no actual votes. In reality, summary can only be <= actual.
Please login to merge, or discard this patch.
tests/PartyTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 
110 110
     private function getMemberFromPersonId($person_id) {
111
-        return new MySociety\TheyWorkForYou\Member([ "person_id" => $person_id ]);
111
+        return new MySociety\TheyWorkForYou\Member(["person_id" => $person_id]);
112 112
     }
113 113
 
114 114
     public function testMPPartyPolicyTextWhenDiffersVotes() {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         // this is a single person party i think - so no party comparison?
140 140
         // need to check what votes would actually produce
141 141
 
142
-        $page = $this->fetch_page(['pid' => 4, 'pagetype' => 'votes','url' => '/mp/4/test_mp_d/test_westminster_constituency/votes']);
142
+        $page = $this->fetch_page(['pid' => 4, 'pagetype' => 'votes', 'url' => '/mp/4/test_mp_d/test_westminster_constituency/votes']);
143 143
         $this->assertStringContainsString('Test MP D', $page);
144 144
         $this->assertStringContainsString('<li class="vote-description"', $page);
145 145
         $this->assertStringNotContainsString('comparable B Party MPs voted', $page);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
         // this is just a boring, person aligned with party example
152 152
 
153
-        $page = $this->fetch_page(['pagetype' => 'votes', 'pid' => 16,  'url' => '/mp/16/test_mp_g_party_2/test_westminster_constituency/votes']);
153
+        $page = $this->fetch_page(['pagetype' => 'votes', 'pid' => 16, 'url' => '/mp/16/test_mp_g_party_2/test_westminster_constituency/votes']);
154 154
         $this->assertStringContainsString('Test MP G Party 2', $page);
155 155
 
156 156
         $this->assertStringNotContainsString('sometimes <b>differs</b> from their party colleagues', $page);
Please login to merge, or discard this patch.
classes/Renderer/Markdown.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         $og_image_parl = $extra_vars['_social_image_parliament'] ?? 'uk';
32 32
         $og_image_url = \MySociety\TheyWorkForYou\Url::generateSocialImageUrl($og_image_title, $og_image_subtitle, $og_image_parl);
33 33
 
34
-        $html = preg_replace_callback('/<h([1-3])>([^<]+)<\/h[1-3]>/i', function ($matches) {
34
+        $html = preg_replace_callback('/<h([1-3])>([^<]+)<\/h[1-3]>/i', function($matches) {
35 35
             $level = $matches[1];
36 36
             $htitle = $matches[2];
37 37
             $slug = slugify($htitle);
Please login to merge, or discard this patch.