| @@ -9,7 +9,7 @@ | ||
| 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 | |
| @@ -133,7 +133,7 @@ discard block | ||
| 133 | 133 | } | 
| 134 | 134 | |
| 135 | 135 |      public function update_email($email) { | 
| 136 | - $this->update_customer([ 'email' => $email ]); | |
| 136 | + $this->update_customer(['email' => $email]); | |
| 137 | 137 | } | 
| 138 | 138 | |
| 139 | 139 |      public function update_payment_method($payment_method) { | 
| @@ -163,7 +163,7 @@ discard block | ||
| 163 | 163 | $error = 'Sorry, we could not process your payment, please try again. '; | 
| 164 | 164 | $error .= 'Our payment processor returned: ' . $err['message']; | 
| 165 | 165 | unset($_POST['stripeToken']); # So card form is shown again | 
| 166 | - return [ $error ]; | |
| 166 | + return [$error]; | |
| 167 | 167 | } | 
| 168 | 168 | |
| 169 | 169 | $customer = $obj->id; | 
| @@ -43,10 +43,10 @@ discard block | ||
| 43 | 43 | |
| 44 | 44 |          try { | 
| 45 | 45 | $accessToken = $helper->getAccessToken(); | 
| 46 | -        } catch(\Facebook\Exceptions\FacebookResponseException $e) { | |
| 46 | +        } catch (\Facebook\Exceptions\FacebookResponseException $e) { | |
| 47 | 47 | $data['error'] = 'Graph returned an error: ' . $e->getMessage(); | 
| 48 | 48 | return $data; | 
| 49 | -        } catch(\Facebook\Exceptions\FacebookSDKException $e) { | |
| 49 | +        } catch (\Facebook\Exceptions\FacebookSDKException $e) { | |
| 50 | 50 | $data['error'] = 'Facebook SDK returned an error: ' . $e->getMessage(); | 
| 51 | 51 | return $data; | 
| 52 | 52 | } | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | return false; | 
| 68 | 68 | } | 
| 69 | 69 | |
| 70 | -        if (! $accessToken->isLongLived()) { | |
| 70 | +        if (!$accessToken->isLongLived()) { | |
| 71 | 71 | $oAuth2Client = $this->getFacebookObject()->getOAuth2Client(); | 
| 72 | 72 |              try { | 
| 73 | 73 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); | 
| @@ -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 | 
| @@ -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\Exception\CardException $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; | 
| @@ -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; |