@@ -512,7 +512,7 @@ |
||
| 512 | 512 | if ($row['totalcomments'] > 1) { |
| 513 | 513 | $morecount = $row['totalcomments'] - 1; |
| 514 | 514 | $plural = $morecount == 1 ? 'annotation' : 'annotations'; |
| 515 | - $linktext = "Read $morecount more $plural"; |
|
| 515 | + $linktext = "read $morecount more $plural"; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | } else { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $DATA->set_page_metadata($this_page, 'title', $year); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $args = [ 'year' => $year ]; |
|
| 144 | + $args = ['year' => $year]; |
|
| 145 | 145 | $data = $this->list->display('calendar', $args, 'none'); |
| 146 | 146 | return $data; |
| 147 | 147 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | protected function display_column($date, $column) { |
| 150 | 150 | global $this_page; |
| 151 | 151 | $this_page = $this->page_base; |
| 152 | - $args = [ 'date' => $date, 'column' => $column ]; |
|
| 152 | + $args = ['date' => $date, 'column' => $column]; |
|
| 153 | 153 | $content = $this->list->display('column', $args, 'none'); |
| 154 | 154 | |
| 155 | 155 | $data = []; |
@@ -169,10 +169,10 @@ discard block |
||
| 169 | 169 | protected function display_day($date) { |
| 170 | 170 | global $this_page; |
| 171 | 171 | $this_page = $this->page_base . 'day'; |
| 172 | - $args = [ 'date' => get_http_var('d') ]; |
|
| 172 | + $args = ['date' => get_http_var('d')]; |
|
| 173 | 173 | $data = $this->list->display('date', $args, 'none'); |
| 174 | 174 | [$year, $month, $day] = explode('-', $date); |
| 175 | - $args = [ 'year' => $year, 'month' => $month, 'day' => $day]; |
|
| 175 | + $args = ['year' => $year, 'month' => $month, 'day' => $day]; |
|
| 176 | 176 | $calendar = $this->list->display('calendar', $args, 'none'); |
| 177 | 177 | if (isset($calendar['years'])) { |
| 178 | 178 | $data['calendar'] = $calendar['years']; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | global $DATA, $this_page, $THEUSER; |
| 185 | 185 | |
| 186 | 186 | # += as we *don't* want to override any already supplied argument |
| 187 | - $args += [ |
|
| 187 | + $args += [ |
|
| 188 | 188 | 'gid' => get_http_var('id'), |
| 189 | 189 | 's' => get_http_var('s'), // Search terms to be highlighted. |
| 190 | 190 | 'member_id' => get_http_var('m'), // Member's speeches to be highlighted. |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $body = $row['body']; |
| 334 | 334 | $body = preg_replace('#<phrase class="honfriend" id="uk.org.publicwhip/member/(\d+)" name="([^"]*?)">(.*?\s*\((.*?)\))</phrase>#', '<a href="/mp/?m=$1" title="Our page on $2 - \'$3\'">$4</a>', $body); |
| 335 | 335 | $body = preg_replace('#<phrase class="honfriend" name="([^"]*?)" person_id="uk.org.publicwhip/person/(\d+)">(.*?\s*\((.*?)\))</phrase>#', '<a href="/mp/?p=$2" title="Our page on $1 - \'$3\'">$4</a>', $body); |
| 336 | - $body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\d+)-(\d+)-(\d+)\.(.*?)">(.*?)</phrase>#', function ($matches) { |
|
| 336 | + $body = preg_replace_callback('#<phrase class="offrep" id="(.*?)/(\d+)-(\d+)-(\d+)\.(.*?)">(.*?)</phrase>#', function($matches) { |
|
| 337 | 337 | return '<a href="/search/?pop=1&s=date:' . $matches[2] . $matches[3] . $matches[4] . '+column:' . $matches[5] . '+section:' . $matches[1] . '">' . str_replace("Official Report", "Hansard", $matches[6]) . '</a>'; |
| 338 | 338 | }, $body); |
| 339 | 339 | #$body = preg_replace('#<phrase class="offrep" id="((.*?)/(\d+)-(\d+)-(\d+)\.(.*?))">(.*?)</phrase>#e', "\"<a href='/search/?pop=1&s=date:$3$4$5+column:$6+section:$2&match=$1'>\" . str_replace('Official Report', 'Hansard', '$7') . '</a>'", $body); |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | <span class="label">Security status:</span> |
| 126 | 126 | <span class="formw"><select name="status"> |
| 127 | 127 | <?php |
| 128 | - foreach ($statuses as $n => $status_name) { ?> |
|
| 128 | + foreach ($statuses as $n => $status_name) { ?> |
|
| 129 | 129 | <option value="<?= $status_name ?>"<?= $status_name == $status ? ' selected' : '' ?>> |
| 130 | 130 | <?= $status_name ?> |
| 131 | 131 | </option> |
@@ -36,7 +36,8 @@ |
||
| 36 | 36 | public function add($searchlogdata) { |
| 37 | 37 | |
| 38 | 38 | $ip = getenv('REMOTE_ADDR'); |
| 39 | - if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { # Googlebot |
|
| 39 | + if (preg_match('#66\.249\.(6[4-9]|[78]\d|9[0-5])\.#', $ip)) { |
|
| 40 | +# Googlebot |
|
| 40 | 41 | return; |
| 41 | 42 | } |
| 42 | 43 | if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('#simplepie|bot#i', $_SERVER['HTTP_USER_AGENT'])) { |
@@ -179,7 +179,7 @@ |
||
| 179 | 179 | |
| 180 | 180 | public function admin_popular_searches($count) { |
| 181 | 181 | |
| 182 | - $q = $this->db->query("SELECT query_string, count(*) AS c FROM search_query_log |
|
| 182 | + $q = $this->db->query("SELECT query_string, count(*) AS c FROM search_query_log |
|
| 183 | 183 | WHERE count_hits != 0 AND query_string NOT LIKE '%speaker:%' |
| 184 | 184 | AND query_time > date_sub(NOW(), INTERVAL 30 DAY) |
| 185 | 185 | GROUP BY query_string ORDER BY c desc LIMIT $count;"); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | remove_form(); |
| 10 | 10 | list_ignored(); |
| 11 | 11 | $PAGE->stripe_end([ |
| 12 | - [ 'type' => 'html', 'content' => $PAGE->admin_menu() ], |
|
| 12 | + ['type' => 'html', 'content' => $PAGE->admin_menu()], |
|
| 13 | 13 | ]); |
| 14 | 14 | $PAGE->page_end(); |
| 15 | 15 | |
@@ -155,7 +155,8 @@ |
||
| 155 | 155 | # The subscription has been created, but it is possible that the |
| 156 | 156 | # payment failed (card error), or we need to do 3DS or similar |
| 157 | 157 | $pi = $invoice->payment_intent; |
| 158 | - if (!$pi) { # Free plan |
|
| 158 | + if (!$pi) { |
|
| 159 | +# Free plan |
|
| 159 | 160 | return; |
| 160 | 161 | } |
| 161 | 162 | if ($pi->status == 'requires_payment_method' || $pi->status == 'requires_source') { |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | |
| 41 | 41 | try { |
| 42 | 42 | $invoice = $sub->latest_invoice; |
| 43 | - $invoice->pay([ 'expand' => [ 'payment_intent' ] ]); |
|
| 43 | + $invoice->pay(['expand' => ['payment_intent']]); |
|
| 44 | 44 | } catch (\Stripe\Exception\CardException $e) { |
| 45 | - $invoice = $subscription->api->client->invoices->retrieve($sub->latest_invoice, ['expand' => [ 'payment_intent'] ]); |
|
| 45 | + $invoice = $subscription->api->client->invoices->retrieve($sub->latest_invoice, ['expand' => ['payment_intent']]); |
|
| 46 | 46 | } |
| 47 | 47 | } else { |
| 48 | 48 | $invoice = $sub->latest_invoice; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | public function update_email($email) { |
| 136 | - $this->update_customer([ 'email' => $email ]); |
|
| 136 | + $this->update_customer(['email' => $email]); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | public function update_payment_method($payment_method) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $error = 'Sorry, we could not process your payment, please try again. '; |
| 164 | 164 | $error .= 'Our payment processor returned: ' . $err['message']; |
| 165 | 165 | unset($_POST['stripeToken']); # So card form is shown again |
| 166 | - return [ $error ]; |
|
| 166 | + return [$error]; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $customer = $obj->id; |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | try { |
| 45 | 45 | $accessToken = $helper->getAccessToken(); |
| 46 | - } catch(\Facebook\Exceptions\FacebookResponseException $e) { |
|
| 46 | + } catch (\Facebook\Exceptions\FacebookResponseException $e) { |
|
| 47 | 47 | $data['error'] = 'Graph returned an error: ' . $e->getMessage(); |
| 48 | 48 | return $data; |
| 49 | - } catch(\Facebook\Exceptions\FacebookSDKException $e) { |
|
| 49 | + } catch (\Facebook\Exceptions\FacebookSDKException $e) { |
|
| 50 | 50 | $data['error'] = 'Facebook SDK returned an error: ' . $e->getMessage(); |
| 51 | 51 | return $data; |
| 52 | 52 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | return false; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (! $accessToken->isLongLived()) { |
|
| 70 | + if (!$accessToken->isLongLived()) { |
|
| 71 | 71 | $oAuth2Client = $this->getFacebookObject()->getOAuth2Client(); |
| 72 | 72 | try { |
| 73 | 73 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | $type = ucfirst(get_http_var('type')); |
| 16 | -$class_name = "MySociety\TheyWorkForYou\SectionView\\${type}View"; |
|
| 16 | +$class_name = "MySociety\TheyWorkForYou\SectionView\\${type}view"; |
|
| 17 | 17 | if (!$type || !class_exists($class_name)) { |
| 18 | 18 | $PAGE->error_message("No type specified", true); |
| 19 | 19 | exit; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | # discard any invalid banners |
| 179 | - $banners = array_filter($banners, function ($banner) { |
|
| 179 | + $banners = array_filter($banners, function($banner) { |
|
| 180 | 180 | return is_valid_item($banner); |
| 181 | 181 | }); |
| 182 | 182 | |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | # discard any invalid announcements |
| 201 | - $items = array_filter($items, function ($item) { |
|
| 201 | + $items = array_filter($items, function($item) { |
|
| 202 | 202 | return is_valid_item($item); |
| 203 | 203 | }); |
| 204 | 204 | |
| 205 | 205 | # limit to announcements with the correct location |
| 206 | - $items = array_filter($items, function ($item) use ($location) { |
|
| 206 | + $items = array_filter($items, function($item) use ($location) { |
|
| 207 | 207 | return in_array($location, $item->location); |
| 208 | 208 | }); |
| 209 | 209 | |