@@ -57,10 +57,10 @@ |
||
57 | 57 | # Update the invoice's PaymentIntent and Charge to say it came from TWFY (for CSV export) |
58 | 58 | # Both are shown in the Stripe admin, annoyingly |
59 | 59 | if ($obj->payment_intent) { |
60 | - \Stripe\PaymentIntent::update($obj->payment_intent, [ 'description' => 'TheyWorkForYou' ]); |
|
60 | + \Stripe\PaymentIntent::update($obj->payment_intent, ['description' => 'TheyWorkForYou']); |
|
61 | 61 | } |
62 | 62 | if ($obj->charge) { |
63 | - \Stripe\Charge::update($obj->charge, [ 'description' => 'TheyWorkForYou' ]); |
|
63 | + \Stripe\Charge::update($obj->charge, ['description' => 'TheyWorkForYou']); |
|
64 | 64 | } |
65 | 65 | } catch (\Stripe\Exception\ApiErrorException $e) { |
66 | 66 | } |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | $existing = $this->alert->fetch_by_token($confirmation); |
122 | 122 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
123 | 123 | $old_mp_id = $matches[1]; |
124 | - $old_mp = new \MySociety\TheyWorkForYou\Member([ 'person_id' => $old_mp_id ]); |
|
125 | - $new_mp = new \MySociety\TheyWorkForYou\Member([ 'constituency' => $old_mp->constituency, 'house' => 1 ]); |
|
124 | + $old_mp = new \MySociety\TheyWorkForYou\Member(['person_id' => $old_mp_id]); |
|
125 | + $new_mp = new \MySociety\TheyWorkForYou\Member(['constituency' => $old_mp->constituency, 'house' => 1]); |
|
126 | 126 | |
127 | 127 | $q = $this->db->query( |
128 | 128 | "SELECT alert_id, criteria, registrationtoken FROM alerts |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
186 | 186 | $criteria = $matches[1]; |
187 | 187 | |
188 | - $old_mp = new \MySociety\TheyWorkForYou\Member([ 'person_id' => $criteria ]); |
|
189 | - $new_mp = new \MySociety\TheyWorkForYou\Member([ 'constituency' => $old_mp->constituency, 'house' => 1 ]); |
|
188 | + $old_mp = new \MySociety\TheyWorkForYou\Member(['person_id' => $criteria]); |
|
189 | + $new_mp = new \MySociety\TheyWorkForYou\Member(['constituency' => $old_mp->constituency, 'house' => 1]); |
|
190 | 190 | |
191 | 191 | if ($this->alert->fetch_by_mp($existing['email'], $new_mp->person_id)) { |
192 | 192 | $data = [ |
@@ -157,7 +157,7 @@ |
||
157 | 157 | $data['search_keyword'] = $this->searchkeyword; |
158 | 158 | |
159 | 159 | $is_adv = false; |
160 | - foreach (['to', 'from', 'person', 'section', 'column', 'phrase', 'exclude' ] as $var) { |
|
160 | + foreach (['to', 'from', 'person', 'section', 'column', 'phrase', 'exclude'] as $var) { |
|
161 | 161 | $key = "search_$var"; |
162 | 162 | $data[$key] = get_http_var($var); |
163 | 163 | if ($data[$key]) { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | if ($last_postcode == $postcode) { |
44 | 44 | $return_value = $mp_only ? $last_postcode_value['WMC'] : $last_postcode_value; |
45 | - twfy_debug("TIME", "Postcode $postcode looked up last time, is " . (is_array($return_value) ? implode(', ', $return_value) : $return_value)); |
|
45 | + twfy_debug("TIME", "postcode $postcode looked up last time, is " . (is_array($return_value) ? implode(', ', $return_value) : $return_value)); |
|
46 | 46 | return $return_value; |
47 | 47 | } |
48 | 48 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | global $hansardmajors; |
39 | 39 | $db = new \ParlDB(); |
40 | 40 | |
41 | - $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", [ ':gid' => $gid ])->first(); |
|
41 | + $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", [':gid' => $gid])->first(); |
|
42 | 42 | $url_gid = fix_gid_from_db($gid); |
43 | 43 | $url = new \MySociety\TheyWorkForYou\Url($hansardmajors[$q['major']]['page']); |
44 | 44 | $url->insert(['id' => $url_gid]); |
@@ -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,16 +271,16 @@ 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 | - * @param bool $committees_only Only return committee memberships. |
|
281 | - * |
|
282 | - * @return array An array of Office objects. |
|
283 | - */ |
|
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 | + * @param bool $committees_only Only return committee memberships. |
|
281 | + * |
|
282 | + * @return array An array of Office objects. |
|
283 | + */ |
|
284 | 284 | |
285 | 285 | public function offices($include_only = null, $ignore_committees = false, $committees_only = false) { |
286 | 286 | |
@@ -338,12 +338,12 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | /** |
341 | - * Get Other Parties String |
|
342 | - * |
|
343 | - * Return a readable list of party changes for this member. |
|
344 | - * |
|
345 | - * @return string|null A readable list of the party changes for this member. |
|
346 | - */ |
|
341 | + * Get Other Parties String |
|
342 | + * |
|
343 | + * Return a readable list of party changes for this member. |
|
344 | + * |
|
345 | + * @return string|null A readable list of the party changes for this member. |
|
346 | + */ |
|
347 | 347 | |
348 | 348 | public function getOtherPartiesString() { |
349 | 349 | |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
365 | - * Get Other Constituencies String |
|
366 | - * |
|
367 | - * Return a readable list of other constituencies for this member. |
|
368 | - * |
|
369 | - * @return string|null A readable list of the other constituencies for this member. |
|
370 | - */ |
|
365 | + * Get Other Constituencies String |
|
366 | + * |
|
367 | + * Return a readable list of other constituencies for this member. |
|
368 | + * |
|
369 | + * @return string|null A readable list of the other constituencies for this member. |
|
370 | + */ |
|
371 | 371 | |
372 | 372 | public function getOtherConstituenciesString() { |
373 | 373 | |
@@ -380,14 +380,14 @@ discard block |
||
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
383 | - * Get Entered/Left Strings |
|
384 | - * |
|
385 | - * Return an array of readable strings covering when people entered or left |
|
386 | - * various houses. Returns an array since it's possible for a member to have |
|
387 | - * done several of these things. |
|
388 | - * |
|
389 | - * @return array An array of strings of when this member entered or left houses. |
|
390 | - */ |
|
383 | + * Get Entered/Left Strings |
|
384 | + * |
|
385 | + * Return an array of readable strings covering when people entered or left |
|
386 | + * various houses. Returns an array since it's possible for a member to have |
|
387 | + * done several of these things. |
|
388 | + * |
|
389 | + * @return array An array of strings of when this member entered or left houses. |
|
390 | + */ |
|
391 | 391 | public function getEnterLeaveStrings() { |
392 | 392 | $output = []; |
393 | 393 |