Passed
Push — master ( ae19d2...73e9f3 )
by
unknown
05:05
created
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.
classes/PolicyDistributionCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             $group_name = $policies->getSetDescriptions()[$set_slug];
67 67
             $group_slug = $set_slug;
68 68
             $comparison_period_slug = $period_slug;
69
-            $policy_pairs = array_filter($pairs, function ($pair) use ($policy_ids) {
69
+            $policy_pairs = array_filter($pairs, function($pair) use ($policy_ids) {
70 70
                 return in_array($pair->getPolicyID(), $policy_ids) && !$pair->member_distribution->noDataAvailable();
71 71
             });
72 72
             $collection = new PolicyDistributionCollection($group_slug, $group_name, $comparison_period_slug, $person_id, $party_slug, $policy_pairs);
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.
www/docs/mp/index.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                 'health', 'education', 'reform', 'home', 'environment',
410 410
                 'transport', 'housing', 'misc',
411 411
             ];
412
-            $sets = array_filter($sets, function ($v) use ($set_descriptions) {
412
+            $sets = array_filter($sets, function($v) use ($set_descriptions) {
413 413
                 return array_key_exists($v, $set_descriptions);
414 414
             });
415 415
             shuffle($sets);
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 function person_error_page($message) {
622 622
     global $this_page;
623 623
     $SEARCHURL = '';
624
-    switch($this_page) {
624
+    switch ($this_page) {
625 625
         case 'peer':
626 626
             $people = new MySociety\TheyWorkForYou\People\Peers();
627 627
             $MPSURL = new \MySociety\TheyWorkForYou\Url('peers');
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
         $SEARCHENGINE = new \SEARCHENGINE($searchstring);
808 808
 
809 809
         $hansard = new MySociety\TheyWorkForYou\Hansard();
810
-        $args =  [
810
+        $args = [
811 811
             's' => $searchstring,
812 812
             'p' => 1,
813 813
             'num' => 3,
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 
1024 1024
     $lang = LANGUAGE;
1025 1025
 
1026
-    $reg = ['chamber_registers' => [] ];
1026
+    $reg = ['chamber_registers' => []];
1027 1027
 
1028 1028
     foreach ($valid_chambers as $chamber) {
1029 1029
         $key = 'person_regmem_' . $chamber . '_' . $lang;
@@ -1038,7 +1038,7 @@  discard block
 block discarded – undo
1038 1038
     }
1039 1039
 
1040 1040
     // sort chamber registers by published_date
1041
-    uasort($reg['chamber_registers'], function ($a, $b) {
1041
+    uasort($reg['chamber_registers'], function($a, $b) {
1042 1042
         return $a->published_date <=> $b->published_date;
1043 1043
     });
1044 1044
 
@@ -1132,8 +1132,8 @@  discard block
 block discarded – undo
1132 1132
         }
1133 1133
     }
1134 1134
 
1135
-    foreach($mreg as $reg) {
1136
-        $data['members'][] =  [
1135
+    foreach ($mreg as $reg) {
1136
+        $data['members'][] = [
1137 1137
             'url' => '/' . $rep_type . '/?p=' . $reg['person_id'],
1138 1138
             'name' => $reg['given_name'] . ' ' . $reg['family_name'],
1139 1139
         ];
Please login to merge, or discard this patch.