@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public $token_checked = null; |
| 41 | 41 | private $alert_id = ""; |
| 42 | 42 | public $email = ""; |
| 43 | - public $criteria = ""; // Sets the terms that are used to produce the search results. |
|
| 43 | + public $criteria = ""; // Sets the terms that are used to produce the search results. |
|
| 44 | 44 | public $ignore_speaker_votes = 0; |
| 45 | 45 | |
| 46 | 46 | private $db; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $contents = ['criteria' => $row['criteria'], 'count' => $row['cnt']]; |
| 73 | 73 | $data[] = $contents; |
| 74 | 74 | } |
| 75 | - $data = ['alerts' => $data]; |
|
| 75 | + $data = ['alerts' => $data]; |
|
| 76 | 76 | return $data; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $data = $q->fetchAll(); |
| 103 | 103 | $info = "Alert"; |
| 104 | - $data = ['info' => $info, 'data' => $data]; |
|
| 104 | + $data = ['info' => $info, 'data' => $data]; |
|
| 105 | 105 | |
| 106 | 106 | return $data; |
| 107 | 107 | } |
@@ -300,12 +300,12 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | // Arrays we need to send a templated email. |
| 303 | - $data = [ |
|
| 303 | + $data = [ |
|
| 304 | 304 | 'to' => $details['email'], |
| 305 | 305 | 'template' => 'alert_confirmation', |
| 306 | 306 | ]; |
| 307 | 307 | |
| 308 | - $merge = [ |
|
| 308 | + $merge = [ |
|
| 309 | 309 | 'CONFIRMURL' => $confirmurl, |
| 310 | 310 | 'CRITERIA' => $this->criteria_pretty(), |
| 311 | 311 | ]; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | public function send_already_signedup_email($details) { |
| 322 | - $data = [ |
|
| 322 | + $data = [ |
|
| 323 | 323 | 'to' => $details['email'], |
| 324 | 324 | 'template' => 'alert_already_signedup', |
| 325 | 325 | ]; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $criteria = \MySociety\TheyWorkForYou\Utility\Alert::detailsToCriteria($details); |
| 328 | 328 | $this->criteria = $criteria; |
| 329 | 329 | |
| 330 | - $merge = [ |
|
| 330 | + $merge = [ |
|
| 331 | 331 | 'CRITERIA' => $this->criteria_pretty(), |
| 332 | 332 | ]; |
| 333 | 333 | |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | <?php } elseif ($step !== '') { ?> |
| 131 | 131 | <?php include '_alert_form.php'; |
| 132 | 132 | } elseif ($this_step == '') { |
| 133 | - if( |
|
| 133 | + if ( |
|
| 134 | 134 | !$results && ( |
| 135 | 135 | $members || |
| 136 | 136 | (isset($constituencies) && count($constituencies) > 0) || |
@@ -139,22 +139,22 @@ discard block |
||
| 139 | 139 | </div> |
| 140 | 140 | <?php } elseif ($step !== '') { ?> |
| 141 | 141 | <?php include '_alert_form.php'; |
| 142 | - } elseif ($this_step == '') { |
|
| 143 | - if( |
|
| 144 | - !$results && ( |
|
| 145 | - $members || |
|
| 142 | + } elseif ($this_step == '') { |
|
| 143 | + if( |
|
| 144 | + !$results && ( |
|
| 145 | + $members || |
|
| 146 | 146 | (isset($constituencies) && count($constituencies) > 0) || |
| 147 | 147 | ($alertsearch) |
| 148 | - ) |
|
| 149 | - ) { |
|
| 150 | - /* We need to disambiguate the user's instructions */ |
|
| 151 | - $member_options = false; |
|
| 152 | - ?> |
|
| 148 | + ) |
|
| 149 | + ) { |
|
| 150 | + /* We need to disambiguate the user's instructions */ |
|
| 151 | + $member_options = false; |
|
| 152 | + ?> |
|
| 153 | 153 | <div class="alert-section alert-section--disambiguation"> |
| 154 | 154 | <div class="alert-section__primary"> |
| 155 | 155 | |
| 156 | 156 | <?php if ($members) { |
| 157 | - $member_options = true; ?> |
|
| 157 | + $member_options = true; ?> |
|
| 158 | 158 | <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3> |
| 159 | 159 | <ul> |
| 160 | 160 | <?php |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | <input type="hidden" name="pid" value="<?= $row['person_id'] ?>"> |
| 168 | 168 | <input type="hidden" name="ignore_speaker_votes" value="<?= $ignore_speaker_votes ?>"> |
| 169 | 169 | <?php |
| 170 | - $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']); |
|
| 170 | + $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']); |
|
| 171 | 171 | if ($row['constituency']) { |
| 172 | 172 | $name .= ' (' . gettext($row['constituency']) . ')'; |
| 173 | 173 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | <?php } ?> |
| 183 | 183 | |
| 184 | 184 | <?php if ($alertsearch) { |
| 185 | - if (!$member_options) { ?> |
|
| 185 | + if (!$member_options) { ?> |
|
| 186 | 186 | <h3><?= gettext('That doesn’t match a person, postcode or constituency. Search again to refine your email alert.') ?></h3> |
| 187 | 187 | <ul> |
| 188 | 188 | <?php if (isset($mistakes['postcode_and'])) { ?> |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | want? You will only get an alert if all of these |
| 194 | 194 | are mentioned in the same debate.') ?> |
| 195 | 195 | <?php if (isset($member_alertsearch)) { |
| 196 | - printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…')); |
|
| 197 | - } ?> |
|
| 196 | + printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…')); |
|
| 197 | + } ?> |
|
| 198 | 198 | </em> |
| 199 | 199 | </li> |
| 200 | 200 | <?php } ?> |
@@ -25,37 +25,37 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function testKeywordOnly() { |
| 28 | - $page = $this->fetch_page([ 'alertsearch' => 'elephant']); |
|
| 28 | + $page = $this->fetch_page(['alertsearch' => 'elephant']); |
|
| 29 | 29 | $this->assertStringContainsString('What word or phrase would you like to receive alerts about', $page); |
| 30 | 30 | $this->assertStringContainsString('<input type="text" id="words0" name="words[]" aria-required="true" value="elephant"', $page); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function testSpeakerId() { |
| 34 | - $page = $this->fetch_page([ 'alertsearch' => 'speaker:2']); |
|
| 34 | + $page = $this->fetch_page(['alertsearch' => 'speaker:2']); |
|
| 35 | 35 | $this->assertStringContainsString('Mrs Test Current-MP', $page); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function testPostCodeOnly() { |
| 39 | - $page = $this->fetch_page([ 'alertsearch' => 'SE17 3HE']); |
|
| 39 | + $page = $this->fetch_page(['alertsearch' => 'SE17 3HE']); |
|
| 40 | 40 | $this->assertStringContainsString('Mrs Test Current-MP', $page); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function testPostCodeWithKeyWord() { |
| 44 | - $page = $this->fetch_page([ 'alertsearch' => 'SE17 3HE elephant']); |
|
| 44 | + $page = $this->fetch_page(['alertsearch' => 'SE17 3HE elephant']); |
|
| 45 | 45 | $this->assertStringContainsString('You have used a postcode and something else', $page); |
| 46 | 46 | $this->assertStringContainsString('Mentions of [elephant] by your MP, Mrs Test Current-MP', $page); |
| 47 | 47 | $this->assertStringNotContainsString('by your MSP', $page); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function testScottishPostcodeWithKeyword() { |
| 51 | - $page = $this->fetch_page([ 'alertsearch' => 'PH6 2DB elephant']); |
|
| 51 | + $page = $this->fetch_page(['alertsearch' => 'PH6 2DB elephant']); |
|
| 52 | 52 | $this->assertStringContainsString('You have used a postcode and something else', $page); |
| 53 | 53 | $this->assertStringContainsString('Mentions of [elephant] by your MP, Mr Test2 Current-MP', $page); |
| 54 | 54 | $this->assertStringContainsString('Mentions of [elephant] by your MSP, Mrs Test Current-MSP', $page); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function testPostcodeAndKeywordWithNoSittingMP() { |
| 58 | - $page = $this->fetch_page([ 'alertsearch' => 'OX1 4LF elephant']); |
|
| 58 | + $page = $this->fetch_page(['alertsearch' => 'OX1 4LF elephant']); |
|
| 59 | 59 | $this->assertStringContainsString('You have used a postcode and something else', $page); |
| 60 | 60 | $this->assertStringNotContainsString('Did you mean to get alerts for when your MP', $page); |
| 61 | 61 | } |
@@ -64,15 +64,15 @@ discard block |
||
| 64 | 64 | * @group xapian |
| 65 | 65 | */ |
| 66 | 66 | public function testBasicKeyWordAlertsCreation() { |
| 67 | - $page = $this->fetch_page([ 'step' => 'define']); |
|
| 67 | + $page = $this->fetch_page(['step' => 'define']); |
|
| 68 | 68 | $this->assertStringContainsString('What word or phrase would you like to receive alerts about', $page); |
| 69 | 69 | $this->assertStringContainsString('<input type="text" id="words0" name="words[]" aria-required="true" value=""', $page); |
| 70 | 70 | |
| 71 | - $page = $this->fetch_page([ 'step' => 'review', 'email' => '[email protected]', 'words[]' => 'fish']); |
|
| 71 | + $page = $this->fetch_page(['step' => 'review', 'email' => '[email protected]', 'words[]' => 'fish']); |
|
| 72 | 72 | $this->assertStringContainsString('Review Your Alert', $page); |
| 73 | 73 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="fish"', $page); |
| 74 | 74 | |
| 75 | - $page = $this->fetch_page([ 'step' => 'confirm', 'email' => '[email protected]', 'words[]' => 'fish']); |
|
| 75 | + $page = $this->fetch_page(['step' => 'confirm', 'email' => '[email protected]', 'words[]' => 'fish']); |
|
| 76 | 76 | $this->assertStringContainsString('We’re nearly done', $page); |
| 77 | 77 | $this->assertStringContainsString('You should receive an email shortly', $page); |
| 78 | 78 | } |
@@ -81,16 +81,16 @@ discard block |
||
| 81 | 81 | * @group xapian |
| 82 | 82 | */ |
| 83 | 83 | public function testMultipleKeyWordAlertsCreation() { |
| 84 | - $page = $this->fetch_page([ 'step' => 'define']); |
|
| 84 | + $page = $this->fetch_page(['step' => 'define']); |
|
| 85 | 85 | $this->assertStringContainsString('What word or phrase would you like to receive alerts about', $page); |
| 86 | 86 | $this->assertStringContainsString('<input type="text" id="words0" name="words[]" aria-required="true" value=""', $page); |
| 87 | 87 | |
| 88 | - $page = $this->fetch_page([ 'step' => 'review', 'email' => '[email protected]', 'words[]' => ['fish', 'salmon']]); |
|
| 88 | + $page = $this->fetch_page(['step' => 'review', 'email' => '[email protected]', 'words[]' => ['fish', 'salmon']]); |
|
| 89 | 89 | $this->assertStringContainsString('Review Your Alert', $page); |
| 90 | 90 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="fish"', $page); |
| 91 | 91 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="salmon"', $page); |
| 92 | 92 | |
| 93 | - $page = $this->fetch_page([ 'step' => 'confirm', 'email' => '[email protected]', 'words[]' => ['fish', 'salmon']]); |
|
| 93 | + $page = $this->fetch_page(['step' => 'confirm', 'email' => '[email protected]', 'words[]' => ['fish', 'salmon']]); |
|
| 94 | 94 | $this->assertStringContainsString('You should receive an email shortly', $page); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | $this->assertStringContainsString('What word or phrase would you like to receive alerts about', $page); |
| 103 | 103 | $this->assertStringContainsString('<input type="text" id="words0" name="words[]" aria-required="true" value=""', $page); |
| 104 | 104 | |
| 105 | - $page = $this->get_page([ 'step' => 'review', 'words[]' => ['fish', 'salmon']]); |
|
| 105 | + $page = $this->get_page(['step' => 'review', 'words[]' => ['fish', 'salmon']]); |
|
| 106 | 106 | $this->assertStringContainsString('Review Your Alert', $page); |
| 107 | 107 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="fish"', $page); |
| 108 | 108 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="salmon"', $page); |
| 109 | 109 | |
| 110 | - $page = $this->get_page([ 'step' => 'confirm', 'words[]' => ['fish', 'salmon']]); |
|
| 110 | + $page = $this->get_page(['step' => 'confirm', 'words[]' => ['fish', 'salmon']]); |
|
| 111 | 111 | $this->assertStringContainsString('You will now receive email alerts on any day when [fish salmon] is mentioned in parliament', $page); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $this->assertStringContainsString('<input type="hidden" name="words[]" value="fish"', $page); |
| 141 | 141 | $this->assertStringContainsString('<input type="hidden" name="representative" value="Mrs Test Current-MP"', $page); |
| 142 | 142 | |
| 143 | - $page = $this->get_page([ 'step' => 'confirm', 'words[]' => 'fish', 'representative' => 'Mrs Test Current-MP']); |
|
| 143 | + $page = $this->get_page(['step' => 'confirm', 'words[]' => 'fish', 'representative' => 'Mrs Test Current-MP']); |
|
| 144 | 144 | $this->assertStringContainsString('You will now receive email alerts on any day when Mrs Test Current-MP mentions [fish] in parliament', $page); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($search_term)) ?></h3> |
| 21 | 21 | <ul> |
| 22 | 22 | <?php |
| 23 | - foreach ($members as $row) { |
|
| 24 | - ?> |
|
| 23 | + foreach ($members as $row) { |
|
| 24 | + ?> |
|
| 25 | 25 | <li> |
| 26 | 26 | <form action="<?= $actionurl ?>" method="post"> |
| 27 | 27 | <input type="hidden" name="t" value="<?= _htmlspecialchars($token) ?>"> |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | <input type="hidden" name="ignore_speaker_votes" value="<?= $ignore_speaker_votes ?>"> |
| 31 | 31 | <?php |
| 32 | 32 | $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']); |
| 33 | - if ($row['constituency']) { |
|
| 34 | - $name .= ' (' . gettext($row['constituency']) . ')'; |
|
| 35 | - } |
|
| 36 | - printf(gettext('When %s speaks.'), $name); |
|
| 37 | - ?> |
|
| 33 | + if ($row['constituency']) { |
|
| 34 | + $name .= ' (' . gettext($row['constituency']) . ')'; |
|
| 35 | + } |
|
| 36 | + printf(gettext('When %s speaks.'), $name); |
|
| 37 | + ?> |
|
| 38 | 38 | <input type="submit" class="button small" value="<?= gettext('Subscribe') ?>"></form> |
| 39 | 39 | </form> |
| 40 | 40 | </li> |
@@ -137,10 +137,10 @@ |
||
| 137 | 137 | <h3><?= gettext('Current keywords in this alert:') ?></h3> |
| 138 | 138 | <ul class="keyword-list"> |
| 139 | 139 | <?php foreach ($keywords as $word) { |
| 140 | - if (!in_array($word, $skip_keyword_terms)) { ?> |
|
| 140 | + if (!in_array($word, $skip_keyword_terms)) { ?> |
|
| 141 | 141 | <li class="keyword-list__tag keyword-list__tag--included"><?= _htmlspecialchars($word) ?> |
| 142 | 142 | <?php } |
| 143 | - } ?> |
|
| 143 | + } ?> |
|
| 144 | 144 | </ul> |
| 145 | 145 | </div> |
| 146 | 146 | |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function testConstituencySearch() { |
| 23 | 23 | $this->assertEquals( |
| 24 | - [ [ 'Alyn and Deeside' ], false ], |
|
| 24 | + [['Alyn and Deeside'], false], |
|
| 25 | 25 | \MySociety\TheyWorkForYou\Utility\Search::searchConstituenciesByQuery('Alyn') |
| 26 | 26 | ); |
| 27 | 27 | $this->assertEquals( |
| 28 | - [ [ 'Alyn and Deeside' ], false ], |
|
| 28 | + [['Alyn and Deeside'], false], |
|
| 29 | 29 | \MySociety\TheyWorkForYou\Utility\Search::searchConstituenciesByQuery('Alyn and Deeside') |
| 30 | 30 | ); |
| 31 | 31 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @group xapian |
| 110 | 110 | */ |
| 111 | 111 | public function testSearchPage() { |
| 112 | - $page = $this->fetch_page([ ]); |
|
| 112 | + $page = $this->fetch_page([]); |
|
| 113 | 113 | $this->assertStringContainsString('Search', $page); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * @group xapian |
| 120 | 120 | */ |
| 121 | 121 | public function testSearchPageMP() { |
| 122 | - $page = $this->fetch_page([ 'q' => 'Mary Smith' ]); |
|
| 122 | + $page = $this->fetch_page(['q' => 'Mary Smith']); |
|
| 123 | 123 | $this->assertStringContainsString('Mary Smith', $page); |
| 124 | 124 | $this->assertMatchesRegularExpression('/MP +for Amber Valley/', $page); |
| 125 | 125 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * @group xapian |
| 131 | 131 | */ |
| 132 | 132 | public function testSearchPageMultipleMP() { |
| 133 | - $page = $this->fetch_page([ 'q' => 'Jones' ]); |
|
| 133 | + $page = $this->fetch_page(['q' => 'Jones']); |
|
| 134 | 134 | $this->assertStringContainsString('People matching <em class="current-search-term">Jones</em>', $page); |
| 135 | 135 | $this->assertStringContainsString('Andrew Jones', $page); |
| 136 | 136 | $this->assertStringContainsString('Simon Jones', $page); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * @group xapian |
| 143 | 143 | */ |
| 144 | 144 | public function testSearchPageCons() { |
| 145 | - $page = $this->fetch_page([ 'q' => 'Amber' ]); |
|
| 145 | + $page = $this->fetch_page(['q' => 'Amber']); |
|
| 146 | 146 | $this->assertStringContainsString('MP for <em class="current-search-term">Amber</em>', $page); |
| 147 | 147 | $this->assertStringContainsString('Mary Smith', $page); |
| 148 | 148 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | * @group xapian |
| 155 | 155 | */ |
| 156 | 156 | public function testSearchPageConsWithNoMp() { |
| 157 | - $page = $this->fetch_page([ 'q' => 'Alyn' ]); |
|
| 157 | + $page = $this->fetch_page(['q' => 'Alyn']); |
|
| 158 | 158 | $this->assertStringNotContainsString('MP for <em class="current-search-term">Alyn</em>', $page); |
| 159 | 159 | $this->assertStringNotContainsString('MPs in constituencies matching', $page); |
| 160 | 160 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @group xapian |
| 167 | 167 | */ |
| 168 | 168 | public function testSearchPageMultipleCons() { |
| 169 | - $page = $this->fetch_page([ 'q' => 'Liverpool' ]); |
|
| 169 | + $page = $this->fetch_page(['q' => 'Liverpool']); |
|
| 170 | 170 | $this->assertStringContainsString('MPs in constituencies matching <em class="current-search-term">Liverpool</em>', $page); |
| 171 | 171 | $this->assertStringContainsString('Susan Brown', $page); |
| 172 | 172 | $this->assertMatchesRegularExpression('/MP +for Liverpool, Riverside/', $page); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * @group xapian |
| 181 | 181 | */ |
| 182 | 182 | public function testSearchPageGlossary() { |
| 183 | - $page = $this->fetch_page([ 'q' => 'other place' ]); |
|
| 183 | + $page = $this->fetch_page(['q' => 'other place']); |
|
| 184 | 184 | $this->assertStringContainsString('Glossary items matching', $page); |
| 185 | 185 | $this->assertStringContainsString('<a href="/glossary/?gl=1">“other place', $page); |
| 186 | 186 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @group xapian |
| 192 | 192 | */ |
| 193 | 193 | public function testSearchPageSpellCorrect() { |
| 194 | - $page = $this->fetch_page([ 'q' => 'plice' ]); |
|
| 194 | + $page = $this->fetch_page(['q' => 'plice']); |
|
| 195 | 195 | $this->assertStringContainsString('Did you mean <a href="/search/?q=place">place', $page); |
| 196 | 196 | } |
| 197 | 197 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @group xapian |
| 202 | 202 | */ |
| 203 | 203 | public function testSearchBySpeakerNoResults() { |
| 204 | - $page = $this->fetch_page([ 'q' => 'splice', 'o' => 'p' ]); |
|
| 204 | + $page = $this->fetch_page(['q' => 'splice', 'o' => 'p']); |
|
| 205 | 205 | $this->assertStringContainsString('Who says splice the most', $page); |
| 206 | 206 | $this->assertStringContainsString('No results', $page); |
| 207 | 207 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | * @group xapian |
| 229 | 229 | */ |
| 230 | 230 | public function testSearchPageRSS() { |
| 231 | - $page = $this->fetch_page([ 'q' => 'test' ]); |
|
| 231 | + $page = $this->fetch_page(['q' => 'test']); |
|
| 232 | 232 | $this->assertStringContainsString('<a href="/search/rss/?s=test">get an RSS feed', $page); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | return; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - $cons_sort = function ($a, $b) { |
|
| 458 | + $cons_sort = function($a, $b) { |
|
| 459 | 459 | if ($a['rep_name'] == $b['rep_name']) { |
| 460 | 460 | if ($a['constituency'] == $b['constituency']) { |
| 461 | 461 | if ($a['member']->family_name == $b['member']->family_name) { |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | foreach ($this->data['member_constituencies'] as $pid) { |
| 533 | 533 | try { |
| 534 | 534 | $MEMBER = new \MySociety\TheyWorkForYou\Member(['person_id' => $pid]); |
| 535 | - $cons[] = [ 'member' => $MEMBER, 'constituency' => $MEMBER->constituency, 'rep_name' => $MEMBER->getMostRecentMembership()['rep_name'] ]; |
|
| 535 | + $cons[] = ['member' => $MEMBER, 'constituency' => $MEMBER->constituency, 'rep_name' => $MEMBER->getMostRecentMembership()['rep_name']]; |
|
| 536 | 536 | } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
| 537 | 537 | // do nothing |
| 538 | 538 | } |
@@ -550,12 +550,12 @@ discard block |
||
| 550 | 550 | $q = $db->query("SELECT person_id FROM member WHERE constituency = :constituency AND house = :house and left_reason = 'still_in_office'", [':constituency' => $constituency, ':house' => $house]); |
| 551 | 551 | foreach ($q as $row) { |
| 552 | 552 | $MEMBER = new \MySociety\TheyWorkForYou\Member(['person_id' => $row['person_id'], 'house' => $house]); |
| 553 | - $cons[] = [ 'member' => $MEMBER, 'constituency' => $constituency, 'rep_name' => $MEMBER->getMostRecentMembership()['rep_name'] ]; |
|
| 553 | + $cons[] = ['member' => $MEMBER, 'constituency' => $constituency, 'rep_name' => $MEMBER->getMostRecentMembership()['rep_name']]; |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | } else { |
| 557 | 557 | $MEMBER = new \MySociety\TheyWorkForYou\Member(['constituency' => $constituency, 'house' => $house]); |
| 558 | - $cons[] = [ 'member' => $MEMBER, 'constituency' => $constituency ]; |
|
| 558 | + $cons[] = ['member' => $MEMBER, 'constituency' => $constituency]; |
|
| 559 | 559 | } |
| 560 | 560 | } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
| 561 | 561 | // do nothing |
@@ -721,7 +721,7 @@ discard block |
||
| 721 | 721 | if ($this->data['pid']) { |
| 722 | 722 | $criteria .= " speaker:" . $this->data['pid']; |
| 723 | 723 | } |
| 724 | - $this->data['search_results'] = $this->getRecentResults($criteria); |
|
| 724 | + $this->data['search_results'] = $this->getRecentResults($criteria); |
|
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | $this->data['criteria'] = $criteria; |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | } |
| 802 | 802 | if ($add) { |
| 803 | 803 | $this->data['all_keywords'][] = $term; |
| 804 | - $alert['search_results'] = $this->getRecentResults($alert["criteria"]); |
|
| 804 | + $alert['search_results'] = $this->getRecentResults($alert["criteria"]); |
|
| 805 | 805 | $this->data['keyword_alerts'][] = $alert; |
| 806 | 806 | } |
| 807 | 807 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - uasort($speakers, function ($a, $b) { |
|
| 116 | + uasort($speakers, function($a, $b) { |
|
| 117 | 117 | |
| 118 | 118 | if ($a['count'] > $b['count']) { |
| 119 | 119 | return -1; |
@@ -256,12 +256,12 @@ discard block |
||
| 256 | 256 | if ($mp_only) { |
| 257 | 257 | $constituency = Postcode::postcodeToConstituency($searchterm); |
| 258 | 258 | if ($constituency) { |
| 259 | - return [ [$constituency], true ]; |
|
| 259 | + return [[$constituency], true]; |
|
| 260 | 260 | } |
| 261 | 261 | } else { |
| 262 | 262 | $constituencies = Postcode::postcodeToConstituencies($searchterm); |
| 263 | 263 | if ($constituencies) { |
| 264 | - return [ $constituencies, true ]; |
|
| 264 | + return [$constituencies, true]; |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | } |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $constituencies[] = $row['name']; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - return [ $constituencies, false ]; |
|
| 283 | + return [$constituencies, false]; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | public static function searchMembersByConstituency($searchterm) { |