@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - uasort($speakers, function ($a, $b) { |
|
118 | + uasort($speakers, function($a, $b) { |
|
119 | 119 | |
120 | 120 | if ($a['count'] > $b['count']) { |
121 | 121 | return -1; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | // Looks like a postcode - can we find the constituency? |
260 | 260 | $constituency = Postcode::postcodeToConstituency($searchterm); |
261 | 261 | if ($constituency) { |
262 | - return [ [$constituency], true ]; |
|
262 | + return [[$constituency], true]; |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $constituencies[] = $row['name']; |
278 | 278 | } |
279 | 279 | |
280 | - return [ $constituencies, false ]; |
|
280 | + return [$constituencies, false]; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
@@ -63,9 +63,9 @@ |
||
63 | 63 | $data['optin_service'] = $optin_values['optin_service']; |
64 | 64 | $data['optin_stream'] = $optin_values['optin_stream']; |
65 | 65 | $data['optin_org'] = $optin_values['optin_org']; |
66 | - $data['postcode'] = $user->postcode(); |
|
66 | + $data['postcode'] = $user->postcode(); |
|
67 | 67 | $data['website'] = $user->url(); |
68 | - $data['registrationtime'] = $user->registrationtime(); |
|
68 | + $data['registrationtime'] = $user->registrationtime(); |
|
69 | 69 | $data['status'] = $user->status(); |
70 | 70 | $data["deleted"] = $user->deleted(); |
71 | 71 | $data["confirmed"] = $user->confirmed(); |
@@ -144,7 +144,7 @@ |
||
144 | 144 | $instance = new $class(); |
145 | 145 | $more_url = new Url($recent[1]); |
146 | 146 | if ($recent[0] == 'recent_pbc_debates') { |
147 | - $content = [ 'data' => $instance->display($recent[0], ['num' => 5], 'none') ]; |
|
147 | + $content = ['data' => $instance->display($recent[0], ['num' => 5], 'none')]; |
|
148 | 148 | } else { |
149 | 149 | $content = $instance->display($recent[0], ['days' => 7, 'num' => 1], 'none'); |
150 | 150 | if (isset($content['data']) && count($content['data'])) { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | usort( |
262 | 262 | $departures, |
263 | - function ($a, $b) { |
|
263 | + function($a, $b) { |
|
264 | 264 | if ($a['date'] == $b['date']) { |
265 | 265 | return 0; |
266 | 266 | } elseif ($a['date'] < $b['date']) { |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | - uasort($policy_diffs, function ($a, $b) { |
|
515 | + uasort($policy_diffs, function($a, $b) { |
|
516 | 516 | return $b['score_difference'] - $a['score_difference']; |
517 | 517 | }); |
518 | 518 |
@@ -213,12 +213,12 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
216 | - * Image |
|
217 | - * |
|
218 | - * Return a URL for the member's image. |
|
219 | - * |
|
220 | - * @return string The URL of the member's image. |
|
221 | - */ |
|
216 | + * Image |
|
217 | + * |
|
218 | + * Return a URL for the member's image. |
|
219 | + * |
|
220 | + * @return string The URL of the member's image. |
|
221 | + */ |
|
222 | 222 | |
223 | 223 | public function image() { |
224 | 224 | |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
274 | - * Offices |
|
275 | - * |
|
276 | - * Return an array of Office objects held (or previously held) by the member. |
|
277 | - * |
|
278 | - * @param string $include_only Restrict the list to include only "previous" or "current" offices. |
|
279 | - * @param bool $ignore_committees Ignore offices that appear to be committee memberships. |
|
280 | - * |
|
281 | - * @return array An array of Office objects. |
|
282 | - */ |
|
274 | + * Offices |
|
275 | + * |
|
276 | + * Return an array of Office objects held (or previously held) by the member. |
|
277 | + * |
|
278 | + * @param string $include_only Restrict the list to include only "previous" or "current" offices. |
|
279 | + * @param bool $ignore_committees Ignore offices that appear to be committee memberships. |
|
280 | + * |
|
281 | + * @return array An array of Office objects. |
|
282 | + */ |
|
283 | 283 | |
284 | 284 | public function offices($include_only = null, $ignore_committees = false) { |
285 | 285 | |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
336 | - * Get Other Parties String |
|
337 | - * |
|
338 | - * Return a readable list of party changes for this member. |
|
339 | - * |
|
340 | - * @return string|null A readable list of the party changes for this member. |
|
341 | - */ |
|
336 | + * Get Other Parties String |
|
337 | + * |
|
338 | + * Return a readable list of party changes for this member. |
|
339 | + * |
|
340 | + * @return string|null A readable list of the party changes for this member. |
|
341 | + */ |
|
342 | 342 | |
343 | 343 | public function getOtherPartiesString() { |
344 | 344 | |
@@ -357,12 +357,12 @@ discard block |
||
357 | 357 | } |
358 | 358 | |
359 | 359 | /** |
360 | - * Get Other Constituencies String |
|
361 | - * |
|
362 | - * Return a readable list of other constituencies for this member. |
|
363 | - * |
|
364 | - * @return string|null A readable list of the other constituencies for this member. |
|
365 | - */ |
|
360 | + * Get Other Constituencies String |
|
361 | + * |
|
362 | + * Return a readable list of other constituencies for this member. |
|
363 | + * |
|
364 | + * @return string|null A readable list of the other constituencies for this member. |
|
365 | + */ |
|
366 | 366 | |
367 | 367 | public function getOtherConstituenciesString() { |
368 | 368 | |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | /** |
378 | - * Get Entered/Left Strings |
|
379 | - * |
|
380 | - * Return an array of readable strings covering when people entered or left |
|
381 | - * various houses. Returns an array since it's possible for a member to have |
|
382 | - * done several of these things. |
|
383 | - * |
|
384 | - * @return array An array of strings of when this member entered or left houses. |
|
385 | - */ |
|
378 | + * Get Entered/Left Strings |
|
379 | + * |
|
380 | + * Return an array of readable strings covering when people entered or left |
|
381 | + * various houses. Returns an array since it's possible for a member to have |
|
382 | + * done several of these things. |
|
383 | + * |
|
384 | + * @return array An array of strings of when this member entered or left houses. |
|
385 | + */ |
|
386 | 386 | public function getEnterLeaveStrings() { |
387 | 387 | $output = []; |
388 | 388 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | define('OPTION_MAPIT_URL', 'https://mapit.mysociety.org/'); |
28 | 28 | |
29 | 29 | // If there isn't a config file (most likely this is running an automated test) copy one in. |
30 | - if (! file_exists(dirname(__FILE__) . '/../conf/general')) { |
|
30 | + if (!file_exists(dirname(__FILE__) . '/../conf/general')) { |
|
31 | 31 | copy(dirname(__FILE__) . '/../conf/general-example', dirname(__FILE__) . '/../conf/general'); |
32 | 32 | } |
33 | 33 |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | // These variables are so we can keep date/time formats consistent across the site |
18 | 18 | // and change them easily. |
19 | 19 | // Formats here: http://www.php.net/manual/en/function.date.php |
20 | -define("LONGERDATEFORMAT", "%A, %e %B %Y");// Monday, 31 December 2003 |
|
21 | -define("LONGDATEFORMAT", "%e %B %Y"); // 31 December 2003 |
|
22 | -define("SHORTDATEFORMAT", "%e %b %Y"); // 31 Dec 2003 |
|
23 | -define("TIMEFORMAT", "%l:%M %p"); // 11:59 pm |
|
20 | +define("LONGERDATEFORMAT", "%A, %e %B %Y"); // Monday, 31 December 2003 |
|
21 | +define("LONGDATEFORMAT", "%e %B %Y"); // 31 December 2003 |
|
22 | +define("SHORTDATEFORMAT", "%e %b %Y"); // 31 Dec 2003 |
|
23 | +define("TIMEFORMAT", "%l:%M %p"); // 11:59 pm |
|
24 | 24 | |
25 | 25 | define("SHORTDATEFORMAT_SQL", "%e %b %Y"); // 31 Dec 2003 |
26 | 26 | define("TIMEFORMAT_SQL", "%l:%i %p"); // 11:59 PM |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | textdomain('TheyWorkForYou'); |
53 | 53 | |
54 | 54 | // Set the default timezone |
55 | -if(function_exists('date_default_timezone_set')) { |
|
55 | +if (function_exists('date_default_timezone_set')) { |
|
56 | 56 | date_default_timezone_set(TIMEZONE); |
57 | 57 | } |
58 | 58 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | include_once(INCLUDESPATH . "easyparliament/user.php"); |
106 | 106 | |
107 | 107 | // Test to see if this is a new-style template using the renderer class. |
108 | -if (! isset($new_style_template) or $new_style_template !== true) { |
|
108 | +if (!isset($new_style_template) or $new_style_template !== true) { |
|
109 | 109 | |
110 | 110 | // This is an old-style page. Use the old page classes. |
111 | 111 | include_once(INCLUDESPATH . "easyparliament/page.php"); |
@@ -548,11 +548,11 @@ |
||
548 | 548 | } |
549 | 549 | if ($limit != '') { |
550 | 550 | # Can't use parameter as >1 argument |
551 | - $limit = "LIMIT $limit"; |
|
551 | + $limit = "limit $limit"; |
|
552 | 552 | } |
553 | 553 | |
554 | 554 | // Finally, do the query! |
555 | - $q = $this->db->query("SELECT $fields |
|
555 | + $q = $this->db->query("select $fields |
|
556 | 556 | FROM comments |
557 | 557 | $join |
558 | 558 | WHERE $where |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | // For getting the data. |
105 | - $input = [ |
|
105 | + $input = [ |
|
106 | 106 | 'amount' => [ |
107 | 107 | 'user' => true, |
108 | 108 | ], |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | // This does rely on both this and the previous query returning |
239 | 239 | // stuff in the same order... |
240 | 240 | foreach ($comments as $n => $commentdata) { |
241 | - $comments[$n]['body'] = $commentbodies[ $comments[$n]['comment_id'] ]; |
|
241 | + $comments[$n]['body'] = $commentbodies[$comments[$n]['comment_id']]; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if (isset($args['pid']) && is_numeric($args['pid'])) { |
284 | 284 | $where['person_id='] = $args['pid']; |
285 | 285 | } |
286 | - $input = [ |
|
286 | + $input = [ |
|
287 | 287 | 'amount' => [ |
288 | 288 | 'user' => true, |
289 | 289 | ], |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | 'date(posted)>=' => $args['start_date'], |
324 | 324 | 'date(posted)<=' => $args['end_date'], |
325 | 325 | ]; |
326 | - $input = [ |
|
326 | + $input = [ |
|
327 | 327 | 'amount' => [ |
328 | 328 | 'user' => true, |
329 | 329 | ], |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | $limit = $num * ($page - 1) . ',' . $num; |
359 | 359 | |
360 | - $input = [ |
|
360 | + $input = [ |
|
361 | 361 | 'amount' => [ |
362 | 362 | 'user' => true, |
363 | 363 | ], |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | // It returns the URL for the comment. |
389 | 389 | |
390 | 390 | $major = $urldata['major']; |
391 | - $gid = $urldata['gid']; |
|
391 | + $gid = $urldata['gid']; |
|
392 | 392 | $comment_id = $urldata['comment_id']; |
393 | 393 | $user_id = $urldata['user_id'] ?? false; |
394 | 394 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $URL = new \MySociety\TheyWorkForYou\Url($page); |
403 | 403 | |
404 | 404 | $gid = fix_gid_from_db($gid); // In includes/utility.php |
405 | - $URL->insert(['id' => $gid ]); |
|
405 | + $URL->insert(['id' => $gid]); |
|
406 | 406 | if ($user_id) { |
407 | 407 | $URL->insert(['u' => $user_id]); |
408 | 408 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $limit = $input['limit'] ?? ''; |
481 | 481 | |
482 | 482 | // The fields to fetch from db. 'table' => array ('field1', 'field2'). |
483 | - $fieldsarr = [ |
|
483 | + $fieldsarr = [ |
|
484 | 484 | 'comments' => ['comment_id', 'user_id', 'epobject_id', 'body', 'posted', 'modflagged', 'visible'], |
485 | 485 | 'hansard' => ['major', 'gid'], |
486 | 486 | ]; |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | |
494 | 494 | // Add on the stuff for getting a user's details. |
495 | 495 | if (isset($amount['user']) && $amount['user'] == true) { |
496 | - $fieldsarr['users'] = ['firstname', 'lastname', 'user_id']; |
|
496 | + $fieldsarr['users'] = ['firstname', 'lastname', 'user_id']; |
|
497 | 497 | // Like doing "FROM comments, users" but it's easier to add |
498 | 498 | // an "INNER JOIN..." automatically to the query. |
499 | 499 | $join .= ' INNER JOIN users ON comments.user_id = users.user_id '; |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $fieldsarr['epobject'] = ['body']; |
505 | 505 | } |
506 | 506 | |
507 | - $fieldsarr2 = []; |
|
507 | + $fieldsarr2 = []; |
|
508 | 508 | // Construct the $fields clause. |
509 | 509 | foreach ($fieldsarr as $table => $tablesfields) { |
510 | 510 | foreach ($tablesfields as $n => $field) { |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $fields = implode(', ', $fieldsarr2); |
522 | 522 | |
523 | 523 | |
524 | - $wherearr2 = []; |
|
524 | + $wherearr2 = []; |
|
525 | 525 | $params = []; |
526 | 526 | $i = 0; |
527 | 527 | // Construct the $where clause. |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | ", $params); |
551 | 551 | |
552 | 552 | // Format the data into an array for returning. |
553 | - $data = []; |
|
553 | + $data = []; |
|
554 | 554 | |
555 | 555 | // If you change stuff here, you might have to change it in |
556 | 556 | // $COMMENT->_set_url() too... |
@@ -12,31 +12,31 @@ discard block |
||
12 | 12 | ], |
13 | 13 | 2001 => [ |
14 | 14 | 1 => ['less' => 8], |
15 | - 2 => ['between' => [15,26]], |
|
16 | - 4 => ['between' => [10,23]], |
|
15 | + 2 => ['between' => [15, 26]], |
|
16 | + 4 => ['between' => [10, 23]], |
|
17 | 17 | 5 => ['more' => 13], |
18 | 18 | 6 => ['less' => 13], |
19 | 19 | 7 => ['more' => 20], |
20 | 20 | 8 => ['all' => 1], |
21 | 21 | 9 => ['less' => 14, 'more' => 14], |
22 | - 10 => ['less' => 4, 'between' => [4,8, 8,15]], |
|
23 | - 12 => ['more' => 19] ], |
|
22 | + 10 => ['less' => 4, 'between' => [4, 8, 8, 15]], |
|
23 | + 12 => ['more' => 19]], |
|
24 | 24 | 2002 => [ |
25 | 25 | 1 => ['less' => 8], |
26 | - 2 => ['between' => [14,25]], |
|
26 | + 2 => ['between' => [14, 25]], |
|
27 | 27 | 3 => ['more' => 26], |
28 | - 4 => ['less' => 3, 'between' => [3,10]], |
|
28 | + 4 => ['less' => 3, 'between' => [3, 10]], |
|
29 | 29 | 5 => ['more' => 24], |
30 | 30 | 6 => ['less' => 10], |
31 | 31 | 7 => ['more' => 24], |
32 | 32 | 8 => ['all' => 1], |
33 | 33 | 9 => ['less' => 19, 'more' => 24], |
34 | 34 | 10 => ['less' => 14], |
35 | - 12 => ['more' => 19] ], |
|
35 | + 12 => ['more' => 19]], |
|
36 | 36 | 2003 => [ |
37 | 37 | 1 => ['less' => 7], |
38 | - 2 => ['between' => [13,24]], |
|
39 | - 4 => ['between' => [14,28]], |
|
38 | + 2 => ['between' => [13, 24]], |
|
39 | + 4 => ['between' => [14, 28]], |
|
40 | 40 | 5 => ['more' => 22], |
41 | 41 | 6 => ['less' => 3], |
42 | 42 | 7 => ['more' => 17], |
@@ -46,18 +46,18 @@ discard block |
||
46 | 46 | 12 => ['more' => 18]], |
47 | 47 | 2004 => [ |
48 | 48 | 1 => ['less' => 5], |
49 | - 2 => ['between' => [12,23]], |
|
50 | - 4 => ['between' => [1,19]], |
|
49 | + 2 => ['between' => [12, 23]], |
|
50 | + 4 => ['between' => [1, 19]], |
|
51 | 51 | 5 => ['more' => 27], |
52 | 52 | 6 => ['less' => 7], |
53 | 53 | 7 => ['more' => 22], |
54 | 54 | 8 => ['all' => 1], |
55 | 55 | 9 => ['less' => 7, 'more' => 16], |
56 | 56 | 10 => ['less' => 11], |
57 | - 12 => ['more' => 21] ], |
|
57 | + 12 => ['more' => 21]], |
|
58 | 58 | 2005 => [ |
59 | 59 | 1 => ['less' => 10], |
60 | - 2 => ['between' => [10,21]], |
|
60 | + 2 => ['between' => [10, 21]], |
|
61 | 61 | 3 => ['more' => 24], |
62 | 62 | 4 => ['less' => 4, 'more' => 10], |
63 | 63 | 5 => ['less' => 11, 'more' => 26], |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | 8 => ['all' => 1], |
67 | 67 | 9 => ['all' => 1], |
68 | 68 | 10 => ['less' => 10], |
69 | - 12 => ['more' => 20] ], |
|
69 | + 12 => ['more' => 20]], |
|
70 | 70 | 2006 => [ |
71 | 71 | 1 => ['less' => 9], |
72 | - 2 => ['between' => [16,27]], |
|
72 | + 2 => ['between' => [16, 27]], |
|
73 | 73 | 3 => ['more' => 30], |
74 | 74 | 4 => ['less' => 18], |
75 | 75 | 5 => ['more' => 25], |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ], |
83 | 83 | 2007 => [ |
84 | 84 | 1 => ['less' => 8], |
85 | - 2 => ['between' => [8,19]], |
|
85 | + 2 => ['between' => [8, 19]], |
|
86 | 86 | 3 => ['more' => 29], |
87 | 87 | 4 => ['less' => 16], |
88 | 88 | 5 => ['more' => 24], |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | ], |
96 | 96 | 2008 => [ |
97 | 97 | 1 => ['less' => 7], |
98 | - 2 => ['between' => [7,18]], |
|
99 | - 4 => ['between' => [3,21]], |
|
98 | + 2 => ['between' => [7, 18]], |
|
99 | + 4 => ['between' => [3, 21]], |
|
100 | 100 | 5 => ['more' => 22], |
101 | 101 | 6 => ['less' => 2], |
102 | 102 | 7 => ['more' => 22], |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | ], |
108 | 108 | 2009 => [ |
109 | 109 | 1 => ['less' => 12], |
110 | - 2 => ['between' => [12,23]], |
|
111 | - 4 => ['between' => [2,20]], |
|
110 | + 2 => ['between' => [12, 23]], |
|
111 | + 4 => ['between' => [2, 20]], |
|
112 | 112 | 5 => ['more' => 21], |
113 | 113 | 6 => ['less' => 1], |
114 | 114 | 7 => ['more' => 21], |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ], |
120 | 120 | 2010 => [ |
121 | 121 | 1 => ['less' => 5], |
122 | - 2 => ['between' => [10,22]], |
|
122 | + 2 => ['between' => [10, 22]], |
|
123 | 123 | 3 => ['more' => 30], |
124 | 124 | 4 => ['less' => 6, 'more' => 8], |
125 | 125 | 5 => ['less' => 18, 'more' => 27], |
@@ -132,62 +132,62 @@ discard block |
||
132 | 132 | ], |
133 | 133 | 2011 => [ |
134 | 134 | 1 => ['less' => 10], |
135 | - 2 => ['between' => [17,28]], |
|
136 | - 4 => ['between' => [5,26]], |
|
135 | + 2 => ['between' => [17, 28]], |
|
136 | + 4 => ['between' => [5, 26]], |
|
137 | 137 | 5 => ['more' => 24], |
138 | 138 | 6 => ['less' => 7], |
139 | 139 | 7 => ['more' => 19], |
140 | 140 | 8 => ['all' => 1], |
141 | 141 | 9 => ['less' => 5, 'more' => 15], |
142 | 142 | 10 => ['less' => 10], |
143 | - 11 => ['between' => [15,21]], |
|
143 | + 11 => ['between' => [15, 21]], |
|
144 | 144 | 12 => ['more' => 20], |
145 | 145 | ], |
146 | 146 | 2012 => [ |
147 | 147 | 1 => ['less' => 10], |
148 | - 2 => ['between' => [9,20]], |
|
148 | + 2 => ['between' => [9, 20]], |
|
149 | 149 | 3 => ['more' => 27], |
150 | 150 | 4 => ['less' => 16], |
151 | 151 | 5 => ['more' => 24], |
152 | 152 | 6 => ['less' => 11], |
153 | 153 | 7 => ['more' => 17], |
154 | 154 | 8 => ['all' => 1], |
155 | - 9 => ['less' => 3,'more' => 18], |
|
155 | + 9 => ['less' => 3, 'more' => 18], |
|
156 | 156 | 10 => ['less' => 15], |
157 | - 11 => ['between' => [13,19]], |
|
157 | + 11 => ['between' => [13, 19]], |
|
158 | 158 | 12 => ['more' => 20], |
159 | 159 | ], |
160 | 160 | 2013 => [ |
161 | 161 | 1 => ['less' => 7], |
162 | - 2 => ['between' => [14,25]], |
|
162 | + 2 => ['between' => [14, 25]], |
|
163 | 163 | 3 => ['more' => 26], |
164 | 164 | 4 => ['less' => 15], |
165 | 165 | 5 => ['more' => 21], |
166 | 166 | 6 => ['less' => 3], |
167 | 167 | 7 => ['more' => 18], |
168 | 168 | 8 => ['all' => 1], |
169 | - 9 => ['less' => 2,'more' => 13], |
|
169 | + 9 => ['less' => 2, 'more' => 13], |
|
170 | 170 | 10 => ['less' => 8], |
171 | - 11 => ['between' => [12,18]], |
|
171 | + 11 => ['between' => [12, 18]], |
|
172 | 172 | 12 => ['more' => 19], |
173 | 173 | ], |
174 | 174 | 2014 => [ |
175 | 175 | 1 => ['less' => 6], |
176 | - 2 => ['between' => [13,24]], |
|
177 | - 4 => ['between' => [10,28]], |
|
178 | - 5 => ['between' => [1,6]], |
|
176 | + 2 => ['between' => [13, 24]], |
|
177 | + 4 => ['between' => [10, 28]], |
|
178 | + 5 => ['between' => [1, 6]], |
|
179 | 179 | ], |
180 | 180 | 2015 => [ |
181 | 181 | 7 => ['more' => 21], |
182 | 182 | 8 => ['all' => 1], |
183 | 183 | 9 => ['less' => 7, 'more' => 17], |
184 | 184 | 10 => ['less' => 12], |
185 | - 11 => ['between' => [10,16]], |
|
185 | + 11 => ['between' => [10, 16]], |
|
186 | 186 | 12 => ['more' => 17], |
187 | 187 | ], |
188 | 188 | 2016 => [ |
189 | 189 | 1 => ['less' => 5], |
190 | - 2 => ['between' => [11,22]], |
|
190 | + 2 => ['between' => [11, 22]], |
|
191 | 191 | ], |
192 | 192 | ]; |
193 | 193 | # Lords differences |
@@ -199,15 +199,15 @@ discard block |
||
199 | 199 | $GLOBALS['recessdates'][101][2010][12]['more'] = 22; |
200 | 200 | $GLOBALS['recessdates'][101][2011] = [ |
201 | 201 | 1 => ['less' => 10], |
202 | - 2 => ['between' => [16,28]], |
|
203 | - 4 => ['between' => [6,26]], |
|
202 | + 2 => ['between' => [16, 28]], |
|
203 | + 4 => ['between' => [6, 26]], |
|
204 | 204 | 5 => ['more' => 25], |
205 | 205 | 6 => ['less' => 6], |
206 | 206 | 7 => ['more' => 20], |
207 | 207 | 8 => ['all' => 1], |
208 | 208 | 9 => ['less' => 5, 'more' => 15], |
209 | 209 | 10 => ['less' => 3], |
210 | - 11 => ['between' => [16,21]], |
|
210 | + 11 => ['between' => [16, 21]], |
|
211 | 211 | 12 => ['more' => 21], |
212 | 212 | ]; |
213 | 213 | |
@@ -216,74 +216,74 @@ discard block |
||
216 | 216 | 1999 => [ |
217 | 217 | 7 => ['more' => 2], |
218 | 218 | 8 => ['less' => 31], |
219 | - 10 => ['between' => [8,25]], |
|
219 | + 10 => ['between' => [8, 25]], |
|
220 | 220 | 12 => ['more' => 17], |
221 | 221 | ], |
222 | 222 | 2000 => [ |
223 | 223 | 1 => ['less' => 10], |
224 | - 4 => ['between' => [7,25]], |
|
224 | + 4 => ['between' => [7, 25]], |
|
225 | 225 | 7 => ['more' => 7], |
226 | 226 | 8 => ['all' => 1], |
227 | 227 | 9 => ['less' => 4], |
228 | - 10 => ['between' => [6,23]], |
|
228 | + 10 => ['between' => [6, 23]], |
|
229 | 229 | 12 => ['more' => 20], |
230 | 230 | ], |
231 | 231 | 2001 => [ |
232 | 232 | 1 => ['less' => 8], |
233 | - 2 => ['between' => [16,26]], |
|
234 | - 4 => ['between' => [6,23]], |
|
233 | + 2 => ['between' => [16, 26]], |
|
234 | + 4 => ['between' => [6, 23]], |
|
235 | 235 | 6 => ['more' => 29], |
236 | 236 | 7 => ['all' => 1], |
237 | 237 | 8 => ['all' => 1], |
238 | 238 | 9 => ['less' => 3], |
239 | - 10 => ['between' => [5,22]], |
|
240 | - 12 => ['more' => 21] ], |
|
239 | + 10 => ['between' => [5, 22]], |
|
240 | + 12 => ['more' => 21]], |
|
241 | 241 | 2002 => [ |
242 | 242 | 1 => ['less' => 7], |
243 | - 2 => ['between' => [15,25]], |
|
243 | + 2 => ['between' => [15, 25]], |
|
244 | 244 | 3 => ['more' => 28], |
245 | 245 | 4 => ['less' => 15], |
246 | 246 | 7 => ['more' => 10], |
247 | 247 | 8 => ['all' => 1], |
248 | 248 | 9 => ['less' => 2], |
249 | - 10 => ['between' => [11,28]], |
|
250 | - 12 => ['more' => 20] ], |
|
249 | + 10 => ['between' => [11, 28]], |
|
250 | + 12 => ['more' => 20]], |
|
251 | 251 | 2003 => [ |
252 | 252 | 1 => ['less' => 6], |
253 | - 4 => ['between' => [0,31]], |
|
253 | + 4 => ['between' => [0, 31]], |
|
254 | 254 | 5 => ['less' => 2], |
255 | 255 | 6 => ['more' => 27], |
256 | 256 | 7 => ['all' => 1], |
257 | 257 | 8 => ['all' => 1], |
258 | - 10 => ['between' => [10,27]], |
|
258 | + 10 => ['between' => [10, 27]], |
|
259 | 259 | 12 => ['more' => 19]], |
260 | 260 | 2004 => [ |
261 | 261 | 1 => ['less' => 5], |
262 | - 2 => ['between' => [13,23]], |
|
263 | - 4 => ['between' => [2,19]], |
|
262 | + 2 => ['between' => [13, 23]], |
|
263 | + 4 => ['between' => [2, 19]], |
|
264 | 264 | 6 => ['more' => 25], |
265 | 265 | 7 => ['all' => 1], |
266 | 266 | 8 => ['less' => 30], |
267 | - 10 => ['between' => [10,23]], |
|
268 | - 12 => ['more' => 26] ], |
|
267 | + 10 => ['between' => [10, 23]], |
|
268 | + 12 => ['more' => 26]], |
|
269 | 269 | 2005 => [ |
270 | 270 | 1 => ['less' => 8], |
271 | - 2 => ['between' => [11,21]], |
|
271 | + 2 => ['between' => [11, 21]], |
|
272 | 272 | 3 => ['more' => 24], |
273 | 273 | 4 => ['less' => 11], |
274 | 274 | 7 => ['more' => 1], |
275 | 275 | 8 => ['all' => 1], |
276 | 276 | 9 => ['less' => 5], |
277 | - 10 => ['between' => [7,24]], |
|
278 | - 12 => ['more' => 23] ], |
|
277 | + 10 => ['between' => [7, 24]], |
|
278 | + 12 => ['more' => 23]], |
|
279 | 279 | 2006 => [ |
280 | 280 | 1 => ['less' => 9], |
281 | - 2 => ['between' => [10,20]], |
|
281 | + 2 => ['between' => [10, 20]], |
|
282 | 282 | 4 => ['less' => 18], |
283 | 283 | 7 => ['more' => 0], |
284 | 284 | 8 => ['all' => 1], |
285 | 285 | 9 => ['less' => 4], |
286 | - 10 => ['between' => [6,23]], |
|
286 | + 10 => ['between' => [6, 23]], |
|
287 | 287 | 12 => ['more' => 22], |
288 | 288 | ], |
289 | 289 | 2007 => [ |
@@ -293,18 +293,18 @@ discard block |
||
293 | 293 | 7 => ['all' => 1], |
294 | 294 | 8 => ['all' => 1], |
295 | 295 | 9 => ['less' => 3], |
296 | - 10 => ['between' => [5,22]], |
|
296 | + 10 => ['between' => [5, 22]], |
|
297 | 297 | 12 => ['more' => 21], |
298 | 298 | ], |
299 | 299 | 2008 => [ |
300 | 300 | 1 => ['less' => 5], |
301 | - 2 => ['between' => [8,18]], |
|
301 | + 2 => ['between' => [8, 18]], |
|
302 | 302 | 3 => ['more' => 28], |
303 | 303 | 4 => ['less' => 14], |
304 | 304 | 6 => ['more' => 27], |
305 | 305 | 7 => ['all' => 1], |
306 | 306 | 8 => ['all' => 1], |
307 | - 10 => ['between' => [10,27]], |
|
307 | + 10 => ['between' => [10, 27]], |
|
308 | 308 | ], |
309 | 309 | ]; |
310 | 310 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | # Force words to lower case |
87 | - $this->query = preg_replace_callback('#(department|party):.+?\b#i', function ($m) { |
|
87 | + $this->query = preg_replace_callback('#(department|party):.+?\b#i', function($m) { |
|
88 | 88 | return strtolower($m[0]); |
89 | 89 | }, $this->query); |
90 | 90 | |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | } elseif ($value == 'lmqs') { |
163 | 163 | $newv = 9; |
164 | 164 | } elseif ($value == 'uk') { |
165 | - $newv = [1,2,3,4,6,101]; |
|
165 | + $newv = [1, 2, 3, 4, 6, 101]; |
|
166 | 166 | } elseif ($value == 'scotland') { |
167 | - $newv = [7,8]; |
|
167 | + $newv = [7, 8]; |
|
168 | 168 | } elseif ($value == 'wales') { |
169 | 169 | $newv = ($lang == 'cy' || LANGUAGE == 'cy') ? 11 : 10; |
170 | 170 | } elseif ($value == 'future') { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $qd = preg_replace('#@[0-9]+#', '', $qd); # Strip position variable |
268 | 268 | $qd = preg_replace('#^\((.*) AND_NOT M1[01]\)$#', '$1', $qd); # Strip Welsh handling |
269 | 269 | # Date range |
270 | - $qd = preg_replace_callback('#VALUE_RANGE 1 (\d+) (\d+)#', function ($m) { |
|
270 | + $qd = preg_replace_callback('#VALUE_RANGE 1 (\d+) (\d+)#', function($m) { |
|
271 | 271 | return preg_replace("#(\d{4})(\d\d)(\d\d)#", '$3/$2/$1', $m[1]) |
272 | 272 | . ".." . preg_replace("#(\d{4})(\d\d)(\d\d)#", '$3/$2/$1', $m[2]); |
273 | 273 | }, $qd); |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $qd = preg_replace('#\bU(\d+)\b#', 'segment:$1', $qd); |
294 | 294 | $qd = preg_replace('#\bC(\d+)\b#', 'column:$1', $qd); |
295 | 295 | $qd = preg_replace('#\bQ(.*?)\b#', 'gid:$1', $qd); |
296 | - $qd = preg_replace_callback('#\bP(.*?)\b#', function ($m) { |
|
296 | + $qd = preg_replace_callback('#\bP(.*?)\b#', function($m) { |
|
297 | 297 | global $parties; |
298 | 298 | $pu = ucfirst($m[1]); |
299 | 299 | return "party:" . ($parties[$pu] ?? $m[1]); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } elseif (strstr($qd, 'M7 OR M8')) { |
306 | 306 | $qd = str_replace('M7 OR M8', 'section:scotland', $qd); |
307 | 307 | } |
308 | - $qd = preg_replace_callback('#\bM(\d+)\b#', function ($m) { |
|
308 | + $qd = preg_replace_callback('#\bM(\d+)\b#', function($m) { |
|
309 | 309 | global $hansardmajors; |
310 | 310 | $title = $hansardmajors[$m[1]]["title"] ?? $m[1]; |
311 | 311 | return sprintf(gettext("in the '%s'"), $title); |
@@ -333,15 +333,15 @@ |
||
333 | 333 | foreach ($merged as $row) { |
334 | 334 | $from_id = str_replace('uk.org.publicwhip/person/', '', $row['gid_from']); |
335 | 335 | $to_id = str_replace('uk.org.publicwhip/person/', '', $row['gid_to']); |
336 | - $qd = str_replace("(S$from_id OR S$to_id)", "S$to_id", $qd); |
|
337 | - $qd = str_replace("S$from_id OR S$to_id", "S$to_id", $qd); |
|
336 | + $qd = str_replace("(S$from_id OR S$to_id)", "s$to_id", $qd); |
|
337 | + $qd = str_replace("s$from_id OR S$to_id", "s$to_id", $qd); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | preg_match_all('#S(\d+)#', $qd, $m); |
341 | 341 | foreach ($m[1] as $mm) { |
342 | 342 | $member = new MEMBER(['person_id' => $mm]); |
343 | 343 | $name = $member->full_name(); |
344 | - $qd = str_replace("S$mm", "speaker:$name", $qd); |
|
344 | + $qd = str_replace("s$mm", "speaker:$name", $qd); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | # Simplify display of excluded words |