Passed
Pull Request — master (#1932)
by Struan
05:36
created
classes/Divisions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $where = [];
69 69
         if ($houses) {
70 70
             if (is_string($houses)) {
71
-                $houses = [ $houses ];
71
+                $houses = [$houses];
72 72
             }
73 73
             $where[] = 'house IN ("' . implode('", "', $houses) . '")';
74 74
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
                     FROM person_names AS pn
411 411
                     WHERE person_id = :person_id
412 412
                     AND start_date <= :division_date AND end_date >= :division_date",
413
-                    [ ':person_id' => $vote['proxy'], ':division_date' => $row['division_date'] ]
413
+                    [':person_id' => $vote['proxy'], ':division_date' => $row['division_date']]
414 414
                 )->first();
415 415
                 $detail['proxy'] = ucfirst(member_full_name(
416 416
                     HOUSE_TYPE_COMMONS,
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
         foreach ($votes as $vote => $count) { // array('yes_votes', 'no_votes', 'absent_votes', 'both_votes') as $vote) {
440 440
             $votes[$vote . '_by_party'] = $votes[$vote];
441
-            usort($votes[$vote . '_by_party'], function ($a, $b) {
441
+            usort($votes[$vote . '_by_party'], function($a, $b) {
442 442
                 return $a['party'] > $b['party'];
443 443
             });
444 444
         }
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
     }
562 562
 
563 563
     private function constructYesNoVoteDescription($direction, $title, $short_text) {
564
-        $text = ' ' ;
564
+        $text = ' ';
565 565
         if ($short_text) {
566 566
             $text .= sprintf(gettext('voted %s'), $short_text);
567 567
         } else {
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 
712 712
         $gid = get_canonical_gid($gid);
713 713
 
714
-        $q = $this->db->query("SELECT gid, major FROM hansard WHERE epobject_id = ( SELECT subsection_id FROM hansard WHERE gid = :gid )", [ ':gid' => $gid ])->first();
714
+        $q = $this->db->query("SELECT gid, major FROM hansard WHERE epobject_id = ( SELECT subsection_id FROM hansard WHERE gid = :gid )", [':gid' => $gid])->first();
715 715
         if (!$q) {
716 716
             return '';
717 717
         }
Please login to merge, or discard this patch.
classes/Url.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         // These stores an associative array of key/value pairs that
43 43
         // we'll want passed on to other pages.
44
-        $this->session_vars =  [];
44
+        $this->session_vars = [];
45 45
 
46 46
         // Prevent things using $DATA running if it hasn't been set, ie in testing
47 47
         if (isset($DATA)) {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
     public function reset() {
94 94
         // Call this to remove all the session_vars.
95
-        $this->session_vars =  [];
95
+        $this->session_vars = [];
96 96
     }
97 97
 
98 98
     /**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         global $DATA;
167 167
 
168
-        $url_args =  [];
168
+        $url_args = [];
169 169
 
170 170
         foreach (array_merge($this->session_vars, $overrideVars) as $key => $var) {
171 171
             if (is_array($var)) {
Please login to merge, or discard this patch.
classes/Renderer/Footer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 class Footer {
13 13
     public $data;
14 14
 
15
-    private $about_links =  ['help', 'about', 'linktous', 'news', 'privacy'];
15
+    private $about_links = ['help', 'about', 'linktous', 'news', 'privacy'];
16 16
     private $assemblies_links = ['hansard', 'sp_home', 'wales_home', 'ni_home', 'london_home'];
17 17
     private $international_links = ['australia', 'ireland', 'mzalendo'];
18 18
     private $tech_links = ['code', 'api', 'data', 'devmailinglist', 'contact'];
Please login to merge, or discard this patch.
classes/People.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -148,20 +148,20 @@  discard block
 block discarded – undo
148 148
 
149 149
         $urls['plain'] = $URL->generate();
150 150
 
151
-        $URL->insert([ 'o' => 'n']);
151
+        $URL->insert(['o' => 'n']);
152 152
         $urls['by_name'] = $URL->generate();
153 153
 
154
-        $URL->insert([ 'o' => 'l']);
154
+        $URL->insert(['o' => 'l']);
155 155
         $urls['by_last'] = $URL->generate();
156 156
 
157
-        $URL->insert([ 'o' => 'f']);
157
+        $URL->insert(['o' => 'f']);
158 158
         $urls['by_first'] = $URL->generate();
159 159
 
160
-        $URL->insert([ 'o' => 'p']);
160
+        $URL->insert(['o' => 'p']);
161 161
         $urls['by_party'] = $URL->generate();
162 162
 
163
-        $URL->insert([ 'f' => 'csv']);
164
-        $URL->remove([ 'o']);
163
+        $URL->insert(['f' => 'csv']);
164
+        $URL->remove(['o']);
165 165
         if ($date = get_http_var('date')) {
166 166
             $URL->insert(['date' => $date]);
167 167
         }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 $constituency = $row['constituency'] ? gettext($row['constituency']) : '';
214 214
                 $party = $row['party'] ? gettext($row['party']) : '';
215 215
                 $url = make_member_url($name, $constituency, $this->house, $p_id);
216
-                $narray =  [
216
+                $narray = [
217 217
                     'person_id' 	=> $p_id,
218 218
                     'given_name' => $row['given_name'],
219 219
                     'family_name' => $row['family_name'],
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             uasort($data, 'by_peer_name');
232 232
         }
233 233
 
234
-        $data =  [
234
+        $data = [
235 235
             'info' =>  [
236 236
                 'order' => $order,
237 237
             ],
Please login to merge, or discard this patch.
classes/SectionView/SpView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     protected function getSearchSections() {
26 26
         return [
27
-            [ 'section' => 'sp' ],
27
+            ['section' => 'sp'],
28 28
         ];
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
classes/SectionView/WransView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
         $data = [];
20 20
 
21
-        $args = [ 'months' => 1 ];
21
+        $args = ['months' => 1];
22 22
         $WRANSLIST = new \WRANSLIST();
23 23
 
24 24
         $wrans = [];
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 
51 51
     protected function getSearchSections() {
52 52
         $sections = [
53
-            [ 'section' => 'wrans', 'title' => 'Written Answers' ],
53
+            ['section' => 'wrans', 'title' => 'Written Answers'],
54 54
         ];
55 55
         if (get_http_var('type') == '') {
56
-            $sections[] = [ 'section' => 'wms', 'title' => 'Written Ministerial Statements' ];
56
+            $sections[] = ['section' => 'wms', 'title' => 'Written Ministerial Statements'];
57 57
         }
58 58
         return $sections;
59 59
     }
Please login to merge, or discard this patch.
classes/SectionView/NiView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     protected function getSearchSections() {
34 34
         return [
35
-            [ 'section' => 'ni' ],
35
+            ['section' => 'ni'],
36 36
         ];
37 37
     }
38 38
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $debates = $DEBATELIST->display('recent_debates', ['days' => 30, 'num' => 6], 'none');
53 53
         $MOREURL = new \MySociety\TheyWorkForYou\Url('nidebatesfront');
54
-        $MOREURL->insert([ 'more' => 1 ]);
54
+        $MOREURL->insert(['more' => 1]);
55 55
 
56 56
         // this makes sure that we don't repeat this debate in the list below
57 57
         $random_debate = null;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         $data['featured'] = $featured;
88
-        $data['debates'] = [ 'recent' => $recent];
88
+        $data['debates'] = ['recent' => $recent];
89 89
 
90 90
         $data['regional'] = $this->getMLAList();
91 91
         $data['search_box'] = $this->getSearchBox($data);
Please login to merge, or discard this patch.
classes/SectionView/DebatesView.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         $DEBATELIST = new \DEBATELIST();
17 17
         $debates = [];
18 18
         $debates['data'] = $DEBATELIST->display('biggest_debates', ['days' => 7, 'num' => 10], 'none');
19
-        $args = [ 'months' => 1 ];
19
+        $args = ['months' => 1];
20 20
         $debates['calendar'] = $DEBATELIST->display('calendar', $args, 'none');
21 21
         $debates['rssurl'] = $DATA->page_metadata($this_page, 'rss');
22 22
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
         $WHALLLIST = new \WHALLLIST();
28 28
         $whall['data'] = $WHALLLIST->display('biggest_debates', ['days' => 7, 'num' => 10], 'none');
29
-        $args = [ 'months' => 1 ];
29
+        $args = ['months' => 1];
30 30
         $whall['calendar'] = $WHALLLIST->display('calendar', $args, 'none');
31 31
         $whall['rssurl'] = $DATA->page_metadata($this_page, 'rss');
32 32
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         $LORDSDEBATELIST = new \LORDSDEBATELIST();
38 38
         $lords['data'] = $LORDSDEBATELIST->display('biggest_debates', ['days' => 7, 'num' => 10], 'none');
39
-        $args = [ 'months' => 1 ];
39
+        $args = ['months' => 1];
40 40
         $lords['calendar'] = $LORDSDEBATELIST->display('calendar', $args, 'none');
41 41
 
42 42
         $lords['rssurl'] = $DATA->page_metadata($this_page, 'rss');
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 
56 56
     protected function getSearchSections() {
57 57
         return [
58
-            [ 'section' => 'debates', 'title' => 'House of Commons' ],
59
-            [ 'section' => 'lords', 'title' => 'House of Lords' ],
60
-            [ 'section' => 'whall', 'title' => 'Westminster Hall' ],
58
+            ['section' => 'debates', 'title' => 'House of Commons'],
59
+            ['section' => 'lords', 'title' => 'House of Lords'],
60
+            ['section' => 'whall', 'title' => 'Westminster Hall'],
61 61
         ];
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
classes/SectionView/SpwransView.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $this_page = 'spwransfront';
22 22
         $data = [];
23 23
 
24
-        $args = [ 'months' => 1 ];
24
+        $args = ['months' => 1];
25 25
         $WRANSLIST = new \SPWRANSLIST();
26 26
 
27 27
         $wrans = [];
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     protected function getSearchSections() {
45 45
         return [
46
-            [ 'section' => 'spwrans' ],
46
+            ['section' => 'spwrans'],
47 47
         ];
48 48
     }
49 49
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     }
77 77
 
78 78
     protected function get_question_mentions_html($row_data) {
79
-        if(count($row_data) == 0) {
79
+        if (count($row_data) == 0) {
80 80
             return '';
81 81
         }
82 82
         $result = '';
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         // Keep the references until after the history that's in a timeline:
86 86
         $references = [];
87 87
         foreach ($row_data as $row) {
88
-            if(! $row["date"]) {
88
+            if (!$row["date"]) {
89 89
                 // If this mention isn't associated with a date, the difference won't be interesting.
90 90
                 $last_date = null;
91 91
             }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 $daysdiff = (int) ((strtotime($row["date"]) - strtotime($last_date)) / 86400);
96 96
                 $daysstring = ($daysdiff == 1) ? "day" : "days";
97 97
                 $further = "";
98
-                if($first_difference_output) {
98
+                if ($first_difference_output) {
99 99
                     $first_difference_output = false;
100 100
                 } else {
101 101
                     $further = " a further";
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                     $inner = "Mentioned in <a class=\"debate-speech__meta__link\" href=\"$url\">tabled written questions on $date</a>";
121 121
                     break;
122 122
                 case 4:
123
-                    if(preg_match('/^uk.org.publicwhip\/spq\/(.*)$/', $row['gid'], $m)) {
123
+                    if (preg_match('/^uk.org.publicwhip\/spq\/(.*)$/', $row['gid'], $m)) {
124 124
                         $URL = new \MySociety\TheyWorkForYou\Url("spwrans");
125 125
                         $URL->insert(['spid' => $m[1]]);
126 126
                         $relative_url = $URL->generate("none");
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                     $inner = "Given a holding answer on $date";
132 132
                     break;
133 133
                 case 6:
134
-                    if(preg_match('/^uk.org.publicwhip\/spor\/(.*)$/', $row['mentioned_gid'], $m)) {
134
+                    if (preg_match('/^uk.org.publicwhip\/spor\/(.*)$/', $row['mentioned_gid'], $m)) {
135 135
                         $URL = new \MySociety\TheyWorkForYou\Url("spdebates");
136 136
                         $URL->insert(['id' => $m[1]]);
137 137
                         $relative_url = $URL->generate("none");
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     }
140 140
                     break;
141 141
                 case 7:
142
-                    if(preg_match('/^uk.org.publicwhip\/spq\/(.*)$/', $row['mentioned_gid'], $m)) {
142
+                    if (preg_match('/^uk.org.publicwhip\/spq\/(.*)$/', $row['mentioned_gid'], $m)) {
143 143
                         $referencing_spid = $m[1];
144 144
                         $URL = new \MySociety\TheyWorkForYou\Url("spwrans");
145 145
                         $URL->insert(['spid' => $referencing_spid]);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     }
150 150
                     break;
151 151
             }
152
-            if($reference) {
152
+            if ($reference) {
153 153
                 $references[] = "\n<li>$inner.";
154 154
             } else {
155 155
                 $result .= "\n<li class=\"link-to-hansard\">$description$inner</span>";
Please login to merge, or discard this patch.