@@ -364,7 +364,7 @@ |
||
364 | 364 | $this->extra_info = array(); |
365 | 365 | |
366 | 366 | $q = $this->db->query('SELECT * FROM moffice WHERE person=:person_id ORDER BY from_date DESC, moffice_id', |
367 | - array(':person_id' => $this->person_id)); |
|
367 | + array(':person_id' => $this->person_id)); |
|
368 | 368 | $this->extra_info['office'] = $q->fetchAll(); |
369 | 369 | |
370 | 370 | // Info specific to member id (e.g. attendance during that period of office) |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
3 | +include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
4 | 4 | |
5 | 5 | class MEMBER { |
6 | 6 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | # All the following only happen if the house to display isn't yet set. |
83 | 83 | # TODO: This relies on interpreting the default value of 0 as a false, which may be error-prone. |
84 | - if (! (bool) $this->house_disp) { |
|
84 | + if (!(bool) $this->house_disp) { |
|
85 | 85 | if ($house == HOUSE_TYPE_LONDON_ASSEMBLY # London Assembly |
86 | 86 | || $house == HOUSE_TYPE_SCOTLAND # MSPs and |
87 | 87 | || $house == HOUSE_TYPE_NI # MLAs have lowest priority |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
244 | - public function postcode_to_person_id($postcode, $house=null) { |
|
245 | - twfy_debug ('MP', "postcode_to_person_id converting postcode to person"); |
|
244 | + public function postcode_to_person_id($postcode, $house = null) { |
|
245 | + twfy_debug('MP', "postcode_to_person_id converting postcode to person"); |
|
246 | 246 | $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($postcode)); |
247 | 247 | return $this->constituency_to_person_id($constituency, $house); |
248 | 248 | } |
249 | 249 | |
250 | - public function constituency_to_person_id($constituency, $house=null) { |
|
250 | + public function constituency_to_person_id($constituency, $house = null) { |
|
251 | 251 | if ($constituency == '') { |
252 | 252 | throw new MySociety\TheyWorkForYou\MemberException('Sorry, no constituency was found.'); |
253 | 253 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | } |
290 | 290 | |
291 | - public function name_to_person_id($name, $const='') { |
|
291 | + public function name_to_person_id($name, $const = '') { |
|
292 | 292 | global $this_page; |
293 | 293 | if ($name == '') { |
294 | 294 | throw new MySociety\TheyWorkForYou\MemberException('Sorry, no name was found.'); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | OR (title=:given_name AND given_name=:middle_name AND family_name=:family_name) |
332 | 332 | )"; |
333 | 333 | } elseif ($this_page == 'royal') { |
334 | - twfy_debug ('MP', $name); |
|
334 | + twfy_debug('MP', $name); |
|
335 | 335 | if (stripos($name, 'elizabeth') !== false) { |
336 | 336 | $q .= "AND person_id=13935"; |
337 | 337 | } elseif (stripos($name, 'charles') !== false) { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | global $THEUSER; |
400 | 400 | if (is_object($THEUSER) && $THEUSER->postcode_is_set() && $this->current_member(1)) { |
401 | 401 | $pc = $THEUSER->postcode(); |
402 | - twfy_debug ('MP', "set_users_mp converting postcode to person"); |
|
402 | + twfy_debug('MP', "set_users_mp converting postcode to person"); |
|
403 | 403 | $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($pc)); |
404 | 404 | if ($constituency == strtolower($this->constituency())) { |
405 | 405 | $this->the_users_mp = true; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | if ($display && array_key_exists('register_member_interests_html', $this->extra_info) && ($this->extra_info['register_member_interests_html'] != '')) { |
481 | - $args = array ( |
|
481 | + $args = array( |
|
482 | 482 | "sort" => "regexp_replace" |
483 | 483 | ); |
484 | 484 | $GLOSSARY = new GLOSSARY($args); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $GLOSSARY->glossarise($this->extra_info['register_member_interests_html']); |
487 | 487 | } |
488 | 488 | |
489 | - $q = $this->db->query('select count(*) as c from alerts where criteria like "%speaker:'.$this->person_id.'%" and confirmed and not deleted')->first(); |
|
489 | + $q = $this->db->query('select count(*) as c from alerts where criteria like "%speaker:' . $this->person_id . '%" and confirmed and not deleted')->first(); |
|
490 | 490 | $this->extra_info['number_of_alerts'] = $q['c']; |
491 | 491 | |
492 | 492 | # Public Bill Committees |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $chairman = $row['c']; |
509 | 509 | $this->extra_info['pbc'][$bill_id] = array( |
510 | 510 | 'title' => $title, 'session' => $row['session'], |
511 | - 'attending'=>$attending, 'chairman'=>($chairman>0), 'outof' => $c |
|
511 | + 'attending'=>$attending, 'chairman'=>($chairman > 0), 'outof' => $c |
|
512 | 512 | ); |
513 | 513 | } |
514 | 514 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | public function family_name() { return $this->family_name; } |
524 | 524 | public function full_name($no_mp_title = false) { |
525 | 525 | $title = $this->title; |
526 | - if ($no_mp_title && ($this->house_disp==HOUSE_TYPE_COMMONS || $this->house_disp==HOUSE_TYPE_NI || $this->house_disp==HOUSE_TYPE_SCOTLAND)) { |
|
526 | + if ($no_mp_title && ($this->house_disp == HOUSE_TYPE_COMMONS || $this->house_disp == HOUSE_TYPE_NI || $this->house_disp == HOUSE_TYPE_SCOTLAND)) { |
|
527 | 527 | $title = ''; |
528 | 528 | } |
529 | 529 | return member_full_name($this->house_disp, $title, $this->given_name, $this->family_name, $this->lordofname); |
@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | public function entered_house($house = null) { |
555 | - if ( isset($house) ) { |
|
556 | - if ( array_key_exists($house, $this->entered_house) ) { |
|
555 | + if (isset($house)) { |
|
556 | + if (array_key_exists($house, $this->entered_house)) { |
|
557 | 557 | return $this->entered_house[$house]; |
558 | 558 | } else { |
559 | 559 | return null; |
@@ -567,9 +567,9 @@ discard block |
||
567 | 567 | return ''; |
568 | 568 | } |
569 | 569 | list($year, $month, $day) = explode('-', $entered_house); |
570 | - if ($month==1 && $day==1 && $this->house(HOUSE_TYPE_LORDS)) { |
|
570 | + if ($month == 1 && $day == 1 && $this->house(HOUSE_TYPE_LORDS)) { |
|
571 | 571 | return $year; |
572 | - } elseif ($month==0 && $day==0) { |
|
572 | + } elseif ($month == 0 && $day == 0) { |
|
573 | 573 | return $year; |
574 | 574 | } elseif (checkdate($month, $day, $year) && $year != '9999') { |
575 | 575 | return format_date($entered_house, LONGDATEFORMAT); |
@@ -579,8 +579,8 @@ discard block |
||
579 | 579 | } |
580 | 580 | |
581 | 581 | public function left_house($house = null) { |
582 | - if ( isset($house) ) { |
|
583 | - if ( array_key_exists($house, $this->left_house) ) { |
|
582 | + if (isset($house)) { |
|
583 | + if (array_key_exists($house, $this->left_house)) { |
|
584 | 584 | return $this->left_house[$house]; |
585 | 585 | } else { |
586 | 586 | return null; |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | list($year, $month, $day) = explode('-', $left_house); |
597 | 597 | if (checkdate($month, $day, $year) && $year != '9999') { |
598 | 598 | return format_date($left_house, LONGDATEFORMAT); |
599 | - } elseif ($month==0 && $day==0) { |
|
599 | + } elseif ($month == 0 && $day == 0) { |
|
600 | 600 | # Left house date is stored as 1942-00-00 to mean "at some point in 1941" |
601 | 601 | return $year - 1; |
602 | 602 | } else { |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | $name = $row['given_name'] . ' ' . $row['family_name']; |
719 | 719 | if ($last_pid != $pid) { |
720 | 720 | $mships[] = array( |
721 | - 'href' => WEBPATH . 'mp/?pid='.$pid, |
|
721 | + 'href' => WEBPATH . 'mp/?pid=' . $pid, |
|
722 | 722 | 'text' => $name |
723 | 723 | ); |
724 | 724 | $last_pid = $pid; |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | $pc = get_http_var('pc'); |
55 | 55 | $pc = preg_replace('#[^a-z0-9]#i', '', $pc); |
56 | 56 | if (validate_postcode($pc)) { |
57 | - twfy_debug ('MP', "MP lookup by postcode"); |
|
57 | + twfy_debug('MP', "MP lookup by postcode"); |
|
58 | 58 | $constituency = strtolower(Utility\Postcode::postcodeToConstituency($pc)); |
59 | 59 | if ($constituency == "connection_timed_out") { |
60 | 60 | throw new \Exception('Sorry, we couldn’t check your postcode right now, as our postcode lookup server is under quite a lot of load.'); |
61 | 61 | } elseif ($constituency == "") { |
62 | - twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
62 | + twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
63 | 63 | throw new \Exception('Sorry, ' . _htmlentities($pc) . ' isn’t a known postcode'); |
64 | 64 | } else { |
65 | 65 | // Generate the Member object |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | } else { |
73 | - twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
73 | + twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
74 | 74 | throw new \Exception('Sorry, ' . _htmlentities($pc) . ' isn’t a valid postcode'); |
75 | 75 | } |
76 | 76 | } catch (\Exception $e) { |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $stances = array(); |
4 | 4 | |
5 | 5 | foreach ($segment['votes']->positions as $key_vote) { |
6 | - if ( $key_vote['has_strong'] || $key_vote['position'] == 'has never voted on' ) { |
|
6 | + if ($key_vote['has_strong'] || $key_vote['position'] == 'has never voted on') { |
|
7 | 7 | $stance = strip_tags($key_vote['desc'], '<b>'); |
8 | 8 | $stance = ucfirst($stance); |
9 | 9 | $stance = preg_replace('#</?b[^>]*>#i', '*', $stance); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | echo '<?xml version="1.0" encoding="utf-8"?>'; |
28 | 28 | |
29 | - ?> |
|
29 | + ?> |
|
30 | 30 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
31 | 31 | <svg width="1000" height="500" viewBox="0 0 1000 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" font-family="Source Sans Pro"> |
32 | 32 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | <text font-size="24" font-weight="normal" fill="#000000"> |
45 | 45 | <?php foreach ($lines as $j=>$line) { ?> |
46 | 46 | <tspan x="40" y="<?= $stance_y + $stance_padding_top + $stance_baseline_offset + ($stance_lineheight * $j) ?>"><?php |
47 | - if (strpos($line, '*') !== False) { |
|
47 | + if (strpos($line, '*') !== false) { |
|
48 | 48 | echo preg_replace( |
49 | 49 | '#(?:^|[*])([^\r\n *][^*\n]*[^\r\n *])(?:$|[*])#i', |
50 | 50 | '$1', |
@@ -41,7 +41,7 @@ |
||
41 | 41 | <div class="row nested-row"> |
42 | 42 | <div class="homepage-in-the-news homepage-content-section"> |
43 | 43 | <?php if ( $featured ) { |
44 | - include dirname(__FILE__) . "/../homepage/featured.php"; |
|
44 | + include dirname(__FILE__) . "/../homepage/featured.php"; |
|
45 | 45 | } ?> |
46 | 46 | </div> |
47 | 47 | <div class="homepage-create-alert homepage-content-section"> |
@@ -4,10 +4,10 @@ discard block |
||
4 | 4 | <div class="hero__mp-search__wrap"> |
5 | 5 | <h1>Do your Assembly Members represent you?</h1> |
6 | 6 | <div class="row collapse"> |
7 | - <?php if ( count($data['regional']) > 0 ) { ?> |
|
7 | + <?php if (count($data['regional']) > 0) { ?> |
|
8 | 8 | <ul class="homepage-rep-list"> |
9 | 9 | <li>Your Assembly Memberss: </li> |
10 | - <?php foreach ( $data['regional'] as $member ) { ?> |
|
10 | + <?php foreach ($data['regional'] as $member) { ?> |
|
11 | 11 | <li class="homepage-rep-list__rep"><a href="/london-assembly-member/?p=<?= $member['person_id'] ?>"><?= $member['name'] ?></a></li> |
12 | 12 | <?php } ?> |
13 | 13 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | <div class="panel panel--flushtop clearfix"> |
41 | 41 | <div class="row nested-row"> |
42 | 42 | <div class="homepage-in-the-news homepage-content-section"> |
43 | - <?php if ( $featured ) { |
|
43 | + <?php if ($featured) { |
|
44 | 44 | include dirname(__FILE__) . "/../homepage/featured.php"; |
45 | 45 | } ?> |
46 | 46 | </div> |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | <div class="homepage-recently homepage-content-section"> |
86 | 86 | <h2>Recently answered questions to the Mayor of London</h2> |
87 | 87 | <ul class="recently__list"><?php |
88 | - foreach ( $debates['recent'] as $recent ) { |
|
88 | + foreach ($debates['recent'] as $recent) { |
|
89 | 89 | include dirname(__FILE__) . '/../homepage/recent-debates.php'; |
90 | 90 | } |
91 | 91 | ?></ul> |
@@ -50,35 +50,35 @@ |
||
50 | 50 | |
51 | 51 | public static function getCountryDetails($house) { |
52 | 52 | $details = array( |
53 | - HOUSE_TYPE_COMMONS => array ( |
|
53 | + HOUSE_TYPE_COMMONS => array( |
|
54 | 54 | 'country' => 'UK', |
55 | 55 | 'assembly' => 'uk-commons', |
56 | 56 | 'location' => '– in the House of Commons', |
57 | 57 | 'cons_type' => 'WMC', |
58 | 58 | 'assembly_name' => 'House of Commons', |
59 | 59 | ), |
60 | - HOUSE_TYPE_NI => array ( |
|
60 | + HOUSE_TYPE_NI => array( |
|
61 | 61 | 'country' => 'NORTHERN IRELAND', |
62 | 62 | 'assembly' => 'ni', |
63 | 63 | 'location' => '– in the Northern Ireland Assembly', |
64 | 64 | 'cons_type' => 'NIE', |
65 | 65 | 'assembly_name' => 'Northern Ireland Assembly', |
66 | 66 | ), |
67 | - HOUSE_TYPE_SCOTLAND => array ( |
|
67 | + HOUSE_TYPE_SCOTLAND => array( |
|
68 | 68 | 'country' => 'SCOTLAND', |
69 | 69 | 'assembly' => 'scotland', |
70 | 70 | 'location' => '– in the Scottish Parliament', |
71 | 71 | 'cons_type' => 'SPC', |
72 | 72 | 'assembly_name' => 'Scottish Parliament', |
73 | 73 | ), |
74 | - HOUSE_TYPE_LORDS => array ( |
|
74 | + HOUSE_TYPE_LORDS => array( |
|
75 | 75 | 'country' => 'UK', |
76 | 76 | 'assembly' => 'uk-lords', |
77 | 77 | 'location' => '– in the House of Lords', |
78 | 78 | 'cons_type' => '', |
79 | 79 | 'assembly_name' => 'House of Lords', |
80 | 80 | ), |
81 | - HOUSE_TYPE_LONDON_ASSEMBLY => array ( |
|
81 | + HOUSE_TYPE_LONDON_ASSEMBLY => array( |
|
82 | 82 | 'country' => 'UK', |
83 | 83 | 'assembly' => 'london-assembly', |
84 | 84 | 'location' => '– in the London Assembly', |
@@ -5,9 +5,9 @@ |
||
5 | 5 | <p>For an explanation of the vote descriptions please see our page about |
6 | 6 | <a href="/voting-information">voting information on TheyWorkForYou</a>.</p> |
7 | 7 | |
8 | - <?php if(isset($data['photo_attribution_text'])) { ?> |
|
8 | + <?php if (isset($data['photo_attribution_text'])) { ?> |
|
9 | 9 | <p> |
10 | - <?php if(isset($data['photo_attribution_link'])) { ?> |
|
10 | + <?php if (isset($data['photo_attribution_link'])) { ?> |
|
11 | 11 | Profile photo: |
12 | 12 | <a href="<?= $data['photo_attribution_link'] ?>"><?= $data['photo_attribution_text'] ?></a> |
13 | 13 | <?php } else { ?> |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function getSearchSections() { |
22 | 22 | return array( |
23 | - array( 'section' => 'lmqs', 'title' => 'Mayoral Questions' ) |
|
23 | + array('section' => 'lmqs', 'title' => 'Mayoral Questions') |
|
24 | 24 | ); |
25 | 25 | } |
26 | 26 | } |
@@ -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\Error\Card $e) { |
45 | - $invoice = \Stripe\Invoice::retrieve($sub->latest_invoice, ['expand' => [ 'payment_intent'] ]); |
|
45 | + $invoice = \Stripe\Invoice::retrieve($sub->latest_invoice, ['expand' => ['payment_intent']]); |
|
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | $invoice = $sub->latest_invoice; |
@@ -53,10 +53,10 @@ |
||
53 | 53 | # Update the invoice's PaymentIntent and Charge to say it came from TWFY (for CSV export) |
54 | 54 | # Both are shown in the Stripe admin, annoyingly |
55 | 55 | if ($obj->payment_intent) { |
56 | - \Stripe\PaymentIntent::update($obj->payment_intent, [ 'description' => 'TheyWorkForYou' ]); |
|
56 | + \Stripe\PaymentIntent::update($obj->payment_intent, ['description' => 'TheyWorkForYou']); |
|
57 | 57 | } |
58 | 58 | if ($obj->charge) { |
59 | - \Stripe\Charge::update($obj->charge, [ 'description' => 'TheyWorkForYou' ]); |
|
59 | + \Stripe\Charge::update($obj->charge, ['description' => 'TheyWorkForYou']); |
|
60 | 60 | } |
61 | 61 | } catch (\Stripe\Error\Base $e) { |
62 | 62 | } |