Passed
Pull Request — master (#1700)
by Struan
04:10
created
www/docs/admin/wikipedia.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
www/includes/dbtypes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 // $Id: dbtypes.php,v 1.8 2009-04-28 13:13:04 matthew Exp $
4 4
 
5 5
 // The type field in the epobject database table
6
-define ('EPTYPE_HANSARD', 1);
7
-define ('EPTYPE_GLOSSARY', 2);
6
+define('EPTYPE_HANSARD', 1);
7
+define('EPTYPE_GLOSSARY', 2);
8 8
 
9 9
 // The major field in the hansard database table
10 10
 $hansardmajors = array(
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 );
122 122
 $hansardmajors[104] = $hansardmajors[4];
123 123
 
124
-$parties = array (
124
+$parties = array(
125 125
     'Bp'    => 'Bishop',
126 126
     'Con'   => 'Conservative',
127 127
     'CWM'   => 'Deputy Speaker',
Please login to merge, or discard this patch.
www/includes/easyparliament/member.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         # All the following only happen if the house to display isn't yet set.
84 84
         # TODO: This relies on interpreting the default value of 0 as a false, which may be error-prone.
85
-        if (! (bool) $this->house_disp) {
85
+        if (!(bool) $this->house_disp) {
86 86
             if ($house == HOUSE_TYPE_LONDON_ASSEMBLY # London Assembly
87 87
                 || $house == HOUSE_TYPE_SCOTLAND     # MSPs and
88 88
                 || $house == HOUSE_TYPE_WALES        # MSs and
@@ -243,13 +243,13 @@  discard block
 block discarded – undo
243 243
         }
244 244
     }
245 245
 
246
-    public function postcode_to_person_id($postcode, $house=null) {
247
-        twfy_debug ('MP', "postcode_to_person_id converting postcode to person");
246
+    public function postcode_to_person_id($postcode, $house = null) {
247
+        twfy_debug('MP', "postcode_to_person_id converting postcode to person");
248 248
         $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($postcode));
249 249
         return $this->constituency_to_person_id($constituency, $house);
250 250
     }
251 251
 
252
-    public function constituency_to_person_id($constituency, $house=null) {
252
+    public function constituency_to_person_id($constituency, $house = null) {
253 253
         if ($constituency == '') {
254 254
             throw new MySociety\TheyWorkForYou\MemberException('Sorry, no constituency was found.');
255 255
         }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         }
291 291
     }
292 292
 
293
-    public function name_to_person_id($name, $const='') {
293
+    public function name_to_person_id($name, $const = '') {
294 294
         global $this_page;
295 295
         if ($name == '') {
296 296
             throw new MySociety\TheyWorkForYou\MemberException('Sorry, no name was found.');
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 OR (title=:given_name AND given_name=:middle_name AND family_name=:family_name)
334 334
             )";
335 335
         } elseif ($this_page == 'royal') {
336
-            twfy_debug ('MP', $name);
336
+            twfy_debug('MP', $name);
337 337
             if (stripos($name, 'elizabeth') !== false) {
338 338
                 $q .= "AND person_id=13935";
339 339
             } elseif (stripos($name, 'charles') !== false) {
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         global $THEUSER;
404 404
         if (is_object($THEUSER) && $THEUSER->postcode_is_set() && $this->current_member(1)) {
405 405
             $pc = $THEUSER->postcode();
406
-            twfy_debug ('MP', "set_users_mp converting postcode to person");
406
+            twfy_debug('MP', "set_users_mp converting postcode to person");
407 407
             $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($pc));
408 408
             if ($constituency == strtolower($this->constituency())) {
409 409
                 $this->the_users_mp = true;
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         }
483 483
 
484 484
         if ($display && array_key_exists('register_member_interests_html', $this->extra_info) && ($this->extra_info['register_member_interests_html'] != '')) {
485
-            $args = array (
485
+            $args = array(
486 486
                 "sort" => "regexp_replace"
487 487
             );
488 488
             $GLOSSARY = new GLOSSARY($args);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
         $GLOSSARY->glossarise($this->extra_info['register_member_interests_html']);
491 491
         }
492 492
 
493
-        $q = $this->db->query('select count(*) as c from alerts where criteria like "%speaker:'.$this->person_id.'%" and confirmed and not deleted')->first();
493
+        $q = $this->db->query('select count(*) as c from alerts where criteria like "%speaker:' . $this->person_id . '%" and confirmed and not deleted')->first();
494 494
         $this->extra_info['number_of_alerts'] = $q['c'];
495 495
 
496 496
         # Public Bill Committees
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             $chairman = $row['c'];
513 513
             $this->extra_info['pbc'][$bill_id] = array(
514 514
                 'title' => $title, 'session' => $row['session'],
515
-                'attending'=>$attending, 'chairman'=>($chairman>0), 'outof' => $c
515
+                'attending'=>$attending, 'chairman'=>($chairman > 0), 'outof' => $c
516 516
             );
517 517
         }
518 518
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
     public function family_name() { return $this->family_name; }
528 528
     public function full_name($no_mp_title = false) {
529 529
         $title = $this->title;
530
-        if ($no_mp_title && ($this->house_disp==HOUSE_TYPE_COMMONS || $this->house_disp==HOUSE_TYPE_NI || $this->house_disp==HOUSE_TYPE_SCOTLAND || $this->house_disp==HOUSE_TYPE_WALES)) {
530
+        if ($no_mp_title && ($this->house_disp == HOUSE_TYPE_COMMONS || $this->house_disp == HOUSE_TYPE_NI || $this->house_disp == HOUSE_TYPE_SCOTLAND || $this->house_disp == HOUSE_TYPE_WALES)) {
531 531
             $title = '';
532 532
         }
533 533
         return member_full_name($this->house_disp, $title, $this->given_name, $this->family_name, $this->lordofname);
@@ -556,8 +556,8 @@  discard block
 block discarded – undo
556 556
     }
557 557
 
558 558
     public function entered_house($house = null) {
559
-        if ( isset($house) ) {
560
-            if ( array_key_exists($house, $this->entered_house) ) {
559
+        if (isset($house)) {
560
+            if (array_key_exists($house, $this->entered_house)) {
561 561
                 return $this->entered_house[$house];
562 562
             } else {
563 563
                 return null;
@@ -571,9 +571,9 @@  discard block
 block discarded – undo
571 571
             return '';
572 572
         }
573 573
         list($year, $month, $day) = explode('-', $entered_house);
574
-        if ($month==1 && $day==1 && $this->house(HOUSE_TYPE_LORDS)) {
574
+        if ($month == 1 && $day == 1 && $this->house(HOUSE_TYPE_LORDS)) {
575 575
             return $year;
576
-        } elseif ($month==0 && $day==0) {
576
+        } elseif ($month == 0 && $day == 0) {
577 577
             return $year;
578 578
         } elseif (checkdate($month, $day, $year) && $year != '9999') {
579 579
             return format_date($entered_house, LONGDATEFORMAT);
@@ -583,8 +583,8 @@  discard block
 block discarded – undo
583 583
     }
584 584
 
585 585
     public function left_house($house = null) {
586
-        if ( isset($house) ) {
587
-            if ( array_key_exists($house, $this->left_house) ) {
586
+        if (isset($house)) {
587
+            if (array_key_exists($house, $this->left_house)) {
588 588
                 return $this->left_house[$house];
589 589
             } else {
590 590
                 return null;
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
         list($year, $month, $day) = explode('-', $left_house);
601 601
         if (checkdate($month, $day, $year) && $year != '9999') {
602 602
             return format_date($left_house, LONGDATEFORMAT);
603
-        } elseif ($month==0 && $day==0) {
603
+        } elseif ($month == 0 && $day == 0) {
604 604
             # Left house date is stored as 1942-00-00 to mean "at some point in 1941"
605 605
             return $year - 1;
606 606
         } else {
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             $name = $row['given_name'] . ' ' . $row['family_name'];
727 727
             if ($last_pid != $pid) {
728 728
                 $mships[] = array(
729
-                    'href' => WEBPATH . 'mp/?pid='.$pid,
729
+                    'href' => WEBPATH . 'mp/?pid=' . $pid,
730 730
                     'text' => $name
731 731
                 );
732 732
                 $last_pid = $pid;
Please login to merge, or discard this patch.
www/docs/topic/topic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
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&rsquo;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&rsquo;t a known postcode');
64 64
                     } else {
65 65
                         // Generate the Member object
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
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&rsquo;t a valid postcode');
75 75
                 }
76 76
             } catch (\Exception $e) {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/votes_svg.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/london/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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">
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
             <div class="hero__mp-search__wrap">
5 5
                 <h1>Find out more about your AMs</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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
classes/SectionView/LondonView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
www/docs/api/key.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,8 @@
 block discarded – undo
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') {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
www/docs/api/hook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.