Passed
Pull Request — master (#1856)
by
unknown
04:46
created
www/includes/easyparliament/glossary.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 include_once INCLUDESPATH . "easyparliament/searchengine.php";
25 25
 
26 26
 class GLOSSARY {
27
-    public $num_terms;			// how many glossary entries do we have
27
+    public $num_terms; // how many glossary entries do we have
28 28
     // (changes depending on how GLOSSARY is called
29
-    public $hansard_count;		// how many times does the phrase appear in hansard?
30
-    public $query;				// search term
31
-    public $glossary_id;		// if this is set then we only have 1 glossary term
32
-    public $current_term;		// will only be set if we have a valid epobject_id
29
+    public $hansard_count; // how many times does the phrase appear in hansard?
30
+    public $query; // search term
31
+    public $glossary_id; // if this is set then we only have 1 glossary term
32
+    public $current_term; // will only be set if we have a valid epobject_id
33 33
     public $current_letter;
34 34
 
35 35
     // constructor...
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         // These stop stupid submissions.
74 74
         // everything should be lowercase.
75
-        $this->stopwords = [ "the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate" ];
75
+        $this->stopwords = ["the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate"];
76 76
 
77 77
     }
78 78
 
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/DivisionsTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
     }
14 14
 
15 15
     private function fetch_division_page() {
16
-        return $this->fetch_page([ 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ]);
16
+        return $this->fetch_page(['pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions']);
17 17
     }
18 18
 
19 19
     private function fetch_mp_recent_page() {
20
-        $vars = [ 'pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent' ];
20
+        $vars = ['pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent'];
21 21
         return $this->base_fetch_page($vars, 'mp', 'index.php', '/mp/recent.php');
22 22
     }
23 23
 
24 24
     private function fetch_recent_page() {
25
-        return $this->base_fetch_page(['url' => '/divisions' ], 'divisions', 'index.php', '/divisions/index.php');
25
+        return $this->base_fetch_page(['url' => '/divisions'], 'divisions', 'index.php', '/divisions/index.php');
26 26
     }
27 27
 
28 28
 
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 
52 52
     public function testMPPageContainsAgreement() {
53 53
         // Checks this MP contains a reference to the agreement
54
-        $page = $this->fetch_page([ 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ]);
54
+        $page = $this->fetch_page(['pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions']);
55 55
         $this->assertStringContainsString('Example Agreement', $page);
56 56
     }
57 57
 
58 58
     public function testMPPageDoesNotContainsAgreement() {
59 59
         // Checks this MP does not contain agreement - should be out of time scope
60
-        $page = $this->fetch_page([ 'pagetype' => 'divisions', 'pid' => 6, 'policy' => 363, 'url' => '/mp/6/test_current-mp/test_westminster_constituency/divisions' ]);
60
+        $page = $this->fetch_page(['pagetype' => 'divisions', 'pid' => 6, 'policy' => 363, 'url' => '/mp/6/test_current-mp/test_westminster_constituency/divisions']);
61 61
         $this->assertStringNotContainsString('Example Agreement', $page);
62 62
         $this->assertStringNotContainsString('This person has not voted on this policy', $page);
63 63
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     }
122 122
 
123 123
     public function testNotEnoughInfoStatement() {
124
-        $page = $this->fetch_page([ 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ]);
124
+        $page = $this->fetch_page(['pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions']);
125 125
         $this->assertStringContainsString('We don’t have enough information to calculate Mrs Test Current-MP’s position', $page);
126 126
     }
127 127
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     }
133 133
 
134 134
     public function testSingleDivision() {
135
-        $page = $this->base_fetch_page(['url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons' ], 'divisions', 'division.php', '/divisions/division.php');
135
+        $page = $this->base_fetch_page(['url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons'], 'divisions', 'division.php', '/divisions/division.php');
136 136
         $this->assertStringContainsString('A majority of MPs  <b>voted in favour</b> of a thing', $page);
137 137
         $this->assertStringContainsString('Aye: 200', $page);
138 138
         $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/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.
www/includes/easyparliament/templates/html/mp/_register_field.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,9 +10,12 @@
 block discarded – undo
10 10
             <?php endforeach; ?>
11 11
             <?php $detail = $upper_detail; ?>
12 12
         </ul>
13
-    <?php else : ?>
13
+    <?php else {
14
+    : ?>
14 15
         <?php if ($detail->value): ?>
15 16
             <span class="interest-detail-value"><?= htmlspecialchars($detail->value) ?></span>
16
-        <?php endif; ?>
17
+        <?php endif;
18
+}
19
+?>
17 20
     <?php endif; ?>
18 21
 </li>
19 22
\ No newline at end of file
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/mp/_register_entry.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,9 +7,12 @@  discard block
 block discarded – undo
7 7
     <?php if ($entry->content): ?>
8 8
         <?php if ($entry->info_type == "subentry"): ?>
9 9
             <h6 class="interest-summary"><?= htmlspecialchars($entry->content) ?></h6>
10
-        <?php else: ?>
10
+        <?php else {
11
+    : ?>
11 12
             <h4 class="interest-summary"><?= htmlspecialchars($entry->content) ?></h4>
12
-        <?php endif; ?>
13
+        <?php endif;
14
+}
15
+?>
13 16
     <?php endif; ?>
14 17
         <ul class="interest-details-list">
15 18
             <?php foreach ($entry->details as $detail): ?>
@@ -26,14 +29,17 @@  discard block
 block discarded – undo
26 29
             <?php endif; ?>
27 30
         </ul>
28 31
 
29
-    <?php else: ?>
32
+    <?php else {
33
+    : ?>
30 34
     <?php if ($entry->content): ?>
31 35
         <?php // This is a more mininal style of entry, don't use the header structure, just print the xml content?>
32 36
         <?php if ($entry->content_format == "xml") : ?>
33 37
             <?= $entry->content ?>
34 38
         <?php else: ?>
35 39
             <p class="interest-content"><?= htmlspecialchars($entry->content) ?></p>
36
-        <?php endif; ?>
40
+        <?php endif;
41
+}
42
+?>
37 43
     <?php endif; ?>
38 44
 <?php endif; ?>
39 45
 
Please login to merge, or discard this patch.