Passed
Push — master ( bda982...e47a27 )
by Sam
09:19 queued 04:25
created
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’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
 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’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>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
 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/Utility/House.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,35 +50,35 @@
 block discarded – undo
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' => '&ndash; 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' => '&ndash; 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' => '&ndash; 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' => '&ndash; 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' => '&ndash; in the London Assembly',
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/_vote_footer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
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 { ?>
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.
www/includes/easyparliament/templates/html/alert/index.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -128,24 +128,24 @@  discard block
 block discarded – undo
128 128
       <?php } ?>
129 129
 
130 130
       <?php
131
-          if(
132
-              (isset($members) && count($members)) ||
131
+            if(
132
+                (isset($members) && count($members)) ||
133 133
               (isset($constituencies) && count($constituencies) > 0) ||
134 134
               ($alertsearch)
135
-          ) {
136
-              /* We need to disambiguate the user's instructions */
137
-              $member_options = false;
138
-      ?>
135
+            ) {
136
+                /* We need to disambiguate the user's instructions */
137
+                $member_options = false;
138
+        ?>
139 139
         <div class="alert-section alert-section--disambiguation">
140 140
             <div class="alert-section__primary">
141 141
 
142 142
               <?php if (isset($members) && count($members)) {
143
-                  $member_options = true; ?>
143
+                    $member_options = true; ?>
144 144
                 <h3>Sign up for alerts when people matching <i><?= _htmlspecialchars($alertsearch) ?></i> speaks</h3>
145 145
                 <ul>
146 146
                   <?php
147 147
                     foreach ($members as $row) {
148
-                  ?>
148
+                    ?>
149 149
                     <li>
150 150
                         <form action="<?= $actionurl ?>" method="post">
151 151
                             <input type="hidden" name="t" value="<?= _htmlspecialchars($token) ?>">
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
               <?php } ?>
166 166
 
167 167
               <?php if (isset($constituencies) && count($constituencies) > 0) {
168
-                  $member_options = true; ?>
168
+                    $member_options = true; ?>
169 169
                 <h3>Sign up for alerts when MPs for constituencies matching <i><?= _htmlspecialchars($alertsearch) ?></i> speaks</h3>
170 170
                 <ul>
171 171
                 <?php foreach ($constituencies as $constituency => $member) { ?>
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <div class="full-page">
2 2
     <div class="full-page__row">
3 3
 
4
-      <?php if ( $message ) { ?>
4
+      <?php if ($message) { ?>
5 5
         <div class="alert-section alert-section--feedback">
6 6
             <div class="alert-section__primary">
7 7
                 <h3><?= $message['title'] ?></h3>
@@ -12,10 +12,10 @@  discard block
 block discarded – undo
12 12
         </div>
13 13
       <?php } ?>
14 14
 
15
-      <?php if ( $results ) { ?>
15
+      <?php if ($results) { ?>
16 16
         <div class="alert-section alert-section--feedback">
17 17
             <div class="alert-section__primary">
18
-              <?php if ( $results == 'alert-confirmed' ) { ?>
18
+              <?php if ($results == 'alert-confirmed') { ?>
19 19
                 <h3>Your alert has been confirmed</h3>
20 20
                 <p>
21 21
                     You will now receive email alerts for the following criteria:
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
                 </div>
46 46
                 </noscript>
47 47
 
48
-              <?php } elseif ( $results == 'alert-suspended' ) { ?>
48
+              <?php } elseif ($results == 'alert-suspended') { ?>
49 49
                 <h3>Alert suspended</h3>
50 50
                 <p>
51 51
                     You can reactivate the alert at any time, from the sidebar below.
52 52
                 </p>
53 53
 
54
-              <?php } elseif ( $results == 'alert-resumed' ) { ?>
54
+              <?php } elseif ($results == 'alert-resumed') { ?>
55 55
                 <h3>Alert resumed</h3>
56 56
                 <p>
57 57
                     You will now receive email alerts on any day when there
58 58
                     are entries in Hansard that match your criteria.
59 59
                 </p>
60 60
 
61
-              <?php } elseif ( $results == 'alert-deleted' ) { ?>
61
+              <?php } elseif ($results == 'alert-deleted') { ?>
62 62
                 <h3>Alert deleted</h3>
63 63
                 <p>
64 64
                     You will no longer receive this alert.
65 65
                 </p>
66 66
 
67
-              <?php } elseif ( $results == 'all-alerts-deleted' ) { ?>
67
+              <?php } elseif ($results == 'all-alerts-deleted') { ?>
68 68
                 <h3>All alerts deleted</h3>
69 69
                 <p>
70 70
                     You will no longer receive any alerts.
71 71
                 </p>
72 72
 
73
-              <?php } elseif ( $results == 'alert-fail' ) { ?>
73
+              <?php } elseif ($results == 'alert-fail') { ?>
74 74
                 <h3>Hmmm, something&rsquo;s not right</h3>
75 75
                 <p>
76 76
                     The link you followed to reach this page appears to be incomplete.
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
                     and let us know, and we'll help out!
87 87
                 </p>
88 88
 
89
-              <?php } elseif ( $results == 'alert-added' ) { ?>
89
+              <?php } elseif ($results == 'alert-added') { ?>
90 90
                 <h3>Your alert has been added</h3>
91 91
                 <p>
92 92
                     You will now receive email alerts on any day when
93 93
                     <?= _htmlspecialchars($criteria) ?> in parliament.
94 94
                 </p>
95 95
 
96
-              <?php } elseif ( $results == 'alert-confirmation' ) { ?>
96
+              <?php } elseif ($results == 'alert-confirmation') { ?>
97 97
                 <h3>We&rsquo;re nearly done&hellip;</h3>
98 98
                 <p>
99 99
                     You should receive an email shortly which will contain a link.
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
                     and receive future alerts. Thanks.
102 102
                 </p>
103 103
 
104
-              <?php } elseif ( $results == 'alert-exists' ) { ?>
104
+              <?php } elseif ($results == 'alert-exists') { ?>
105 105
                 <h3>You&rsquo;re already subscribed to that!</h3>
106 106
                 <p>
107 107
                     It&rsquo;s good to know you&rsquo;re keen though.
108 108
                 </p>
109 109
 
110
-              <?php } elseif ( $results == 'alert-already-signed' ) { ?>
110
+              <?php } elseif ($results == 'alert-already-signed') { ?>
111 111
                 <h3>We&rsquo;re nearly done</h3>
112 112
                 <p>
113 113
                     You should receive an email shortly which will contain a link.
114 114
                     You will need to follow that link to confirm your email address to receive the alert. Thanks.
115 115
                 </p>
116 116
 
117
-              <?php } elseif ( $results == 'alert-fail' ) { ?>
117
+              <?php } elseif ($results == 'alert-fail') { ?>
118 118
                 <h3>Alert could not be created</h3>
119 119
                 <p>
120 120
                     Sorry, we were unable to create that alert. Please
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
       <?php } ?>
129 129
 
130 130
       <?php
131
-          if(
131
+          if (
132 132
               (isset($members) && count($members)) ||
133 133
               (isset($constituencies) && count($constituencies) > 0) ||
134 134
               ($alertsearch)
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                             <input type="hidden" name="email" value="<?= _htmlspecialchars($email) ?>">
153 153
                             <input type="hidden" name="pid" value="<?= $row['person_id'] ?>">
154 154
                             When
155
-                            <?= member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname'] ) ?>
155
+                            <?= member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']) ?>
156 156
                             <?php if ($row['constituency']) { ?>
157 157
                                 (<?= $row['constituency'] ?>)
158 158
                             <?php } ?>
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
               <?php } ?>
184 184
 
185 185
               <?php if ($alertsearch) {
186
-                if ( $member_options ) { ?>
186
+                if ($member_options) { ?>
187 187
                 <h3>Sign up for alerts for topics</h3>
188 188
                 <?php } else { ?>
189 189
                 <h3>Great! Can you just confirm what you mean?</h3>
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                             Receive alerts when <?= _htmlspecialchars($alertsearch_pretty) ?>
198 198
                             <input type="submit" class="button small" value="Subscribe">
199 199
                         </form>
200
-                      <?php if ( isset($mistakes['multiple']) ) { ?>
200
+                      <?php if (isset($mistakes['multiple'])) { ?>
201 201
                         <em class="error">
202 202
                             You have used a comma in your search term &ndash;
203 203
                             are you sure this is what you want? You cannot
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                             for each individual term.
207 207
                         </em>
208 208
                       <?php } ?>
209
-                      <?php if ( isset($mistakes['postcode_and']) ) { ?>
209
+                      <?php if (isset($mistakes['postcode_and'])) { ?>
210 210
                         <em class="error">
211 211
                             You have used a postcode and something else in your
212 212
                             search term &ndash; are you sure this is what you
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
             <div class="alert-section__secondary">
256 256
               <?php if ($email_verified) { ?>
257 257
 
258
-                  <?php if ( $alerts ) { ?>
258
+                  <?php if ($alerts) { ?>
259 259
                     <?php include('_list.php'); ?>
260 260
                   <?php } ?>
261 261
 
262
-                  <?php if ( $current_mp ) { ?>
262
+                  <?php if ($current_mp) { ?>
263 263
                     <h3>Your MP alert</h3>
264 264
                     <ul class="alerts-manage__list">
265 265
                         <li>
Please login to merge, or discard this patch.