@@ -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 |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | |
6 | 6 | <p><?= gettext('For an explanation of the vote descriptions please see our page about <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 | <?= gettext('Profile photo:') ?> |
12 | 12 | <a href="<?= $data['photo_attribution_link'] ?>"><?= $data['photo_attribution_text'] ?></a> |
13 | 13 | <?php } else { ?> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | <?php } ?> |
16 | 16 | </p> |
17 | 17 | <?php } ?> |
18 | - <?php if(!$image || !$image['exists']) { ?> |
|
18 | + <?php if (!$image || !$image['exists']) { ?> |
|
19 | 19 | <p> |
20 | 20 | We’re missing a photo of <?= $full_name ?>. |
21 | 21 | If you have a photo <em>that you can release under |
@@ -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 = [ |
@@ -210,7 +210,7 @@ |
||
210 | 210 | $has_strong = 1; |
211 | 211 | } |
212 | 212 | $full_sentence = $consistency . ' ' . $policy_description; |
213 | - $out = [ 'full_sentence' => $full_sentence, 'score' => $dmpscore, 'position' => $consistency, 'has_strong' => $has_strong ]; |
|
213 | + $out = ['full_sentence' => $full_sentence, 'score' => $dmpscore, 'position' => $consistency, 'has_strong' => $has_strong]; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $out; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | $title = $matches[1]; |
36 | 36 | |
37 | - $html = preg_replace_callback('/<h([1-3])>([^<]+)<\/h[1-3]>/i', function ($matches) { |
|
37 | + $html = preg_replace_callback('/<h([1-3])>([^<]+)<\/h[1-3]>/i', function($matches) { |
|
38 | 38 | $level = $matches[1]; |
39 | 39 | $htitle = $matches[2]; |
40 | 40 | $slug = slugify($htitle); |
@@ -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]); |