Passed
Push — master ( 4c090a...f12e7b )
by Struan
06:21
created
www/includes/easyparliament/templates/html/mp/votes_svg.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
     <text font-size="24" font-weight="normal" fill="#000000">
45 45
         <?php foreach ($lines as $j => $line) { ?>
46 46
             <tspan x="40" y="<?= $stance_y + $stance_padding_top + $stance_baseline_offset + ($stance_lineheight * $j) ?>"><?php
47
-               if (strpos($line, '*') !== false) {
48
-                   echo preg_replace(
49
-                       '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i',
50
-                       '$1',
51
-                       $line
52
-                   );
53
-               } else {
54
-                   echo $line;
55
-               }
47
+                if (strpos($line, '*') !== false) {
48
+                    echo preg_replace(
49
+                        '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i',
50
+                        '$1',
51
+                        $line
52
+                    );
53
+                } else {
54
+                    echo $line;
55
+                }
56 56
             ?></tspan>
57 57
         <?php } ?>
58 58
     </text>
Please login to merge, or discard this patch.
www/includes/easyparliament/commentreportlist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $data = [];
98 98
         foreach ($q as $row) {
99
-            $data[] =  [
99
+            $data[] = [
100 100
                 'report_id'		=> $row['report_id'],
101 101
                 'comment_id' 	=> $row['comment_id'],
102 102
                 'firstname'		=> $row['firstname'],
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             ];
108 108
         }
109 109
         foreach ($r as $row) {
110
-            $data[] =  [
110
+            $data[] = [
111 111
                 'report_id'		=> $row['report_id'],
112 112
                 'comment_id' 	=> $row['comment_id'],
113 113
                 'firstname'		=> $row['firstname'],
Please login to merge, or discard this patch.
www/includes/easyparliament/member.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         # All the following only happen if the house to display isn't yet set.
88 88
         # TODO: This relies on interpreting the default value of 0 as a false, which may be error-prone.
89
-        if (! (bool) $this->house_disp) {
89
+        if (!(bool) $this->house_disp) {
90 90
             if ($house == HOUSE_TYPE_LONDON_ASSEMBLY # London Assembly
91 91
                 || $house == HOUSE_TYPE_SCOTLAND     # MSPs and
92 92
                 || $house == HOUSE_TYPE_WALES        # MSs and
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             $policiesList = new Policies($policyID);
252 252
         }
253 253
         $rel_agreements = $policiesList->all_policy_agreements[$policyID] ?? [];
254
-        $rel_agreements = array_filter($rel_agreements, function ($agreement) use ($house) {
254
+        $rel_agreements = array_filter($rel_agreements, function($agreement) use ($house) {
255 255
             return $this->date_in_memberships($house, $agreement['date']);
256 256
         });
257 257
         return $rel_agreements;
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         }
527 527
 
528 528
         if ($display && array_key_exists('register_member_interests_html', $this->extra_info) && ($this->extra_info['register_member_interests_html'] != '')) {
529
-            $args =  [
529
+            $args = [
530 530
                 "sort" => "regexp_replace",
531 531
             ];
532 532
             $GLOSSARY = new GLOSSARY($args);
Please login to merge, or discard this patch.
www/includes/dbtypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@
 block discarded – undo
158 158
 ];
159 159
 $hansardmajors[104] = $hansardmajors[4];
160 160
 
161
-$parties =  [
161
+$parties = [
162 162
     'Bp'    => 'Bishop',
163 163
     'Con'   => 'Conservative',
164 164
     'CWM'   => 'Deputy Speaker',
Please login to merge, or discard this patch.
tests/SectionTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function testDebatesFront() {
18 18
         foreach ($this->types as $type) {
19
-            $page = $this->fetch_page([ 'type' => $type ]);
19
+            $page = $this->fetch_page(['type' => $type]);
20 20
             $this->assertStringContainsString($type, $page);
21 21
         }
22 22
     }
23 23
 
24 24
     public function testDebatesYear() {
25 25
         foreach ($this->types as $type) {
26
-            $page = $this->fetch_page([ 'type' => $type, 'y' => '2014' ]);
26
+            $page = $this->fetch_page(['type' => $type, 'y' => '2014']);
27 27
             $this->assertStringContainsString('<div class="calendar">', $page);
28 28
             $this->assertStringContainsString('January', $page);
29 29
             $this->assertMatchesRegularExpression('/<td colspan="2">&nbsp;<\/td><td[^>]*><a href="\/' . $type . '\/\?d=2014-01-01">1<\/a><\/td><td[^>]*><span>2<\/span><\/td>/', $page);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public function testDebatesDay() {
34 34
         foreach ($this->types as $type) {
35
-            $page = $this->fetch_page([ 'type' => $type, 'd' => '2014-01-01' ]);
35
+            $page = $this->fetch_page(['type' => $type, 'd' => '2014-01-01']);
36 36
             $this->assertStringContainsString('Wednesday,  1 January 2014', $page);
37 37
             $this->assertStringContainsString('HeadingA', $page);
38 38
             if ($type == 'wrans') {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 continue;
58 58
             }
59 59
 
60
-            $page = $this->fetch_page([ 'type' => $type, 'id' => '2014-01-01b.1.1' ]);
60
+            $page = $this->fetch_page(['type' => $type, 'id' => '2014-01-01b.1.1']);
61 61
             if ($type == 'wrans') {
62 62
                 $this->assertMatchesRegularExpression("#All .*?written answers on  1 Jan 2014#i", $page);
63 63
                 $this->assertStringContainsString("QuestionA", $page);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function testDebatesSubheading() {
71 71
         foreach ($this->types as $type) {
72
-            $page = $this->fetch_page([ 'type' => $type, 'id' => '2014-01-01b.1.2' ]);
72
+            $page = $this->fetch_page(['type' => $type, 'id' => '2014-01-01b.1.2']);
73 73
             $this->assertStringContainsString("HeadingA", $page);
74 74
             if ($type == 'spwrans') {
75 75
                 $this->assertStringContainsString("QuestionA", $page);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     public function testDebatesSpeech() {
101 101
         foreach ($this->types as $type) {
102
-            $page = $this->fetch_page([ 'type' => $type, 'id' => '2014-01-01b.1.3' ]);
102
+            $page = $this->fetch_page(['type' => $type, 'id' => '2014-01-01b.1.3']);
103 103
             if ($type == 'wrans' || $type == 'spwrans' || $type == 'wms') {
104 104
                 $this->assertMatchesRegularExpression("#Location: .*?/$type/\?id=2014-01-01b\.1\.2#", $page);
105 105
             } else {
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
      * @group xapian
125 125
      */
126 126
     public function testGlossaryAndSearchHighlights() {
127
-        $page = $this->fetch_page([ 'type' => 'lords', 's' => 'constituency', 'id' => '2014-02-02b.1.3' ]);
127
+        $page = $this->fetch_page(['type' => 'lords', 's' => 'constituency', 'id' => '2014-02-02b.1.3']);
128 128
         $this->assertStringContainsString("constituency", $page);
129 129
         $this->assertStringContainsString("<span class=\"hi\"><a href=\"/glossary/?gl=1\" title=\"In a general election, each Constituency chooses an MP to represent them....\" class=\"glossary\">constituency</a></span>", $page);
130 130
     }
131 131
 
132 132
     public function testGidRedirect() {
133
-        $page = $this->fetch_page([ 'type' => 'wrans', 'id' => '2014-01-01a.187335.h' ]);
133
+        $page = $this->fetch_page(['type' => 'wrans', 'id' => '2014-01-01a.187335.h']);
134 134
         $this->assertMatchesRegularExpression("#Location: .*?/wrans/\?id=2014-01-01b\.1\.2#", $page);
135 135
     }
136 136
 }
Please login to merge, or discard this patch.
classes/DataClass/Regmem/Person.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,6 +42,6 @@
 block discarded – undo
42 42
                 return $category;
43 43
             }
44 44
         }
45
-        throw new InvalidArgumentException("Category $categoryId not found in register");
45
+        throw new InvalidArgumentException("category $categoryId not found in register");
46 46
     }
47 47
 }
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/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.