@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | # Sort into order, largest first |
109 | - usort($phrases, function ($a, $b) { |
|
109 | + usort($phrases, function($a, $b) { |
|
110 | 110 | return strlen($a) < strlen($b); |
111 | 111 | }); |
112 | 112 | |
@@ -156,31 +156,31 @@ discard block |
||
156 | 156 | |
157 | 157 | public static function antiTagInTag($content = '', $format = 'htmlhead') { |
158 | 158 | $tagend = -1; |
159 | - for($tagstart = strpos($content, '<', $tagend + 1) ; $tagstart !== false && $tagstart < strlen($content); $tagstart = strpos($content, '<', $tagend)) { |
|
159 | + for ($tagstart = strpos($content, '<', $tagend + 1); $tagstart !== false && $tagstart < strlen($content); $tagstart = strpos($content, '<', $tagend)) { |
|
160 | 160 | // got the start of a tag. Now find the proper end! |
161 | 161 | $walker = $tagstart + 1; |
162 | 162 | $open = 1; |
163 | - while($open != 0 && $walker < strlen($content)) { |
|
163 | + while ($open != 0 && $walker < strlen($content)) { |
|
164 | 164 | $nextopen = strpos($content, '<', $walker); |
165 | 165 | $nextclose = strpos($content, '>', $walker); |
166 | - if($nextclose === false) { |
|
166 | + if ($nextclose === false) { |
|
167 | 167 | // ERROR! Open waka without close waka! |
168 | 168 | // echo '<code>Error in antiTagInTag - malformed tag!</code> '; |
169 | 169 | return $content; |
170 | 170 | } |
171 | - if($nextopen === false || $nextopen > $nextclose) { |
|
171 | + if ($nextopen === false || $nextopen > $nextclose) { |
|
172 | 172 | // No more opens, but there was a close; or, a close happens before the next open. |
173 | 173 | // walker goes to the close+1, and open decrements |
174 | 174 | $open--; |
175 | 175 | $walker = $nextclose + 1; |
176 | - } elseif($nextopen < $nextclose) { |
|
176 | + } elseif ($nextopen < $nextclose) { |
|
177 | 177 | // an open before the next close |
178 | 178 | $open++; |
179 | 179 | $walker = $nextopen + 1; |
180 | 180 | } |
181 | 181 | } |
182 | 182 | $tagend = $walker; |
183 | - if($tagend > strlen($content)) { |
|
183 | + if ($tagend > strlen($content)) { |
|
184 | 184 | $tagend = strlen($content); |
185 | 185 | } else { |
186 | 186 | $tagend--; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | $o = get_http_var('o'); |
15 | - $args = [ |
|
15 | + $args = [ |
|
16 | 16 | 's' => $this->searchstring, |
17 | 17 | 'p' => $pagenum, |
18 | 18 | 'num' => get_http_var('num'), |
@@ -246,22 +246,22 @@ discard block |
||
246 | 246 | |
247 | 247 | if ($page != 1) { |
248 | 248 | $prev_page = $page - 1; |
249 | - $URL->insert([ 'p' => $prev_page ]); |
|
249 | + $URL->insert(['p' => $prev_page]); |
|
250 | 250 | $pagelinks['prev'] = [ |
251 | 251 | 'url' => $URL->generate(), |
252 | 252 | ]; |
253 | - $URL->insert([ 'p' => 1 ]); |
|
253 | + $URL->insert(['p' => 1]); |
|
254 | 254 | $pagelinks['firstpage'] = [ |
255 | 255 | 'url' => $URL->generate(), |
256 | 256 | ]; |
257 | 257 | } |
258 | 258 | if ($page != $numpages) { |
259 | 259 | $next_page = $page + 1; |
260 | - $URL->insert([ 'p' => $next_page ]); |
|
260 | + $URL->insert(['p' => $next_page]); |
|
261 | 261 | $pagelinks['next'] = [ |
262 | 262 | 'url' => $URL->generate(), |
263 | 263 | ]; |
264 | - $URL->insert([ 'p' => $numpages ]); |
|
264 | + $URL->insert(['p' => $numpages]); |
|
265 | 265 | $pagelinks['lastpage'] = [ |
266 | 266 | 'url' => $URL->generate(), |
267 | 267 | ]; |
@@ -68,7 +68,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -41,7 +41,7 @@ discard block |
||
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 |
||
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 |
||
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)) { |
@@ -12,7 +12,7 @@ |
||
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']; |
@@ -148,20 +148,20 @@ discard block |
||
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 |
||
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 |
||
231 | 231 | uasort($data, 'by_peer_name'); |
232 | 232 | } |
233 | 233 | |
234 | - $data = [ |
|
234 | + $data = [ |
|
235 | 235 | 'info' => [ |
236 | 236 | 'order' => $order, |
237 | 237 | ], |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected function getSearchSections() { |
26 | 26 | return [ |
27 | - [ 'section' => 'sp' ], |
|
27 | + ['section' => 'sp'], |
|
28 | 28 | ]; |
29 | 29 | } |
30 | 30 | } |
@@ -18,7 +18,7 @@ discard block |
||
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 |
||
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 | } |
@@ -32,7 +32,7 @@ discard block |
||
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 |
||
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 |
||
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); |