@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | $data['has_expenses'] = $data['leave_date'] > '2004-01-01'; |
| 359 | 359 | |
| 360 | 360 | $data['pre_2010_expenses'] = false; |
| 361 | -$data['post_2010_expenses'] = $data['leave_date'] > '2010-05-05' ? ($MEMBER->extra_info['datadotparl_id']??'') : ''; |
|
| 361 | +$data['post_2010_expenses'] = $data['leave_date'] > '2010-05-05' ? ($MEMBER->extra_info['datadotparl_id'] ?? '') : ''; |
|
| 362 | 362 | |
| 363 | 363 | if ($data['entry_date'] < '2010-05-05') { |
| 364 | 364 | $data['pre_2010_expenses'] = true; |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | $divisions = new MySociety\TheyWorkForYou\Divisions($MEMBER); |
| 393 | 393 | $policySummaries = $divisions->getMemberDivisionDetails(true); |
| 394 | 394 | |
| 395 | - $policyOptions = [ 'summaries' => $policySummaries]; |
|
| 395 | + $policyOptions = ['summaries' => $policySummaries]; |
|
| 396 | 396 | |
| 397 | 397 | // Generate voting segments |
| 398 | 398 | $set_descriptions = $policiesList->getSetDescriptions(); |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | |
| 430 | 430 | $data['sorted_diffs_only'] = array_filter( |
| 431 | 431 | $data['sorted_diffs'], |
| 432 | - function ($k) { return $k['score_difference'] >= 2; } |
|
| 432 | + function($k) { return $k['score_difference'] >= 2; } |
|
| 433 | 433 | ); |
| 434 | 434 | |
| 435 | 435 | // Send the output for rendering |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | function person_error_page($message) { |
| 641 | 641 | global $this_page; |
| 642 | 642 | $SEARCHURL = ''; |
| 643 | - switch($this_page) { |
|
| 643 | + switch ($this_page) { |
|
| 644 | 644 | case 'peer': |
| 645 | 645 | $people = new MySociety\TheyWorkForYou\People\Peers(); |
| 646 | 646 | $MPSURL = new \MySociety\TheyWorkForYou\Url('peers'); |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $SEARCHENGINE = new \SEARCHENGINE($searchstring); |
| 826 | 826 | |
| 827 | 827 | $hansard = new MySociety\TheyWorkForYou\Hansard(); |
| 828 | - $args = [ |
|
| 828 | + $args = [ |
|
| 829 | 829 | 's' => $searchstring, |
| 830 | 830 | 'p' => 1, |
| 831 | 831 | 'num' => 3, |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | return; |
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | - $reg = [ 'date' => '', 'data' => '<p>Nil</p>' ]; |
|
| 1003 | + $reg = ['date' => '', 'data' => '<p>Nil</p>']; |
|
| 1004 | 1004 | if (isset($extra_info['register_member_interests_date'])) { |
| 1005 | 1005 | $reg['date'] = format_date($extra_info['register_member_interests_date'], SHORTDATEFORMAT); |
| 1006 | 1006 | } |
@@ -1097,8 +1097,8 @@ discard block |
||
| 1097 | 1097 | } |
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | - foreach($mreg as $reg) { |
|
| 1101 | - $data['members'][] = [ |
|
| 1100 | + foreach ($mreg as $reg) { |
|
| 1101 | + $data['members'][] = [ |
|
| 1102 | 1102 | 'url' => '/' . $rep_type . '/?p=' . $reg['person_id'], |
| 1103 | 1103 | 'name' => $reg['given_name'] . ' ' . $reg['family_name'], |
| 1104 | 1104 | ]; |
@@ -13,16 +13,16 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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. |
@@ -16,14 +16,14 @@ discard block |
||
| 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"> <\/td><td[^>]*><a href="\/' . $type . '\/\?d=2014-01-01">1<\/a><\/td><td[^>]*><span>2<\/span><\/td>/', $page); |
@@ -32,7 +32,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |