@@ -24,24 +24,24 @@ |
||
24 | 24 | public static function house_to_members($house) { |
25 | 25 | $house_to_members = array( |
26 | 26 | HOUSE_TYPE_COMMONS => array( |
27 | - 'singular' => 'MP', |
|
28 | - 'plural' => 'MPs' |
|
27 | + 'singular' => 'MP', |
|
28 | + 'plural' => 'MPs' |
|
29 | 29 | ), |
30 | 30 | HOUSE_TYPE_LORDS => array( |
31 | - 'singular' => 'Member of the House of Lords', |
|
32 | - 'plural' => 'Members of the House of Lords' |
|
31 | + 'singular' => 'Member of the House of Lords', |
|
32 | + 'plural' => 'Members of the House of Lords' |
|
33 | 33 | ), |
34 | 34 | HOUSE_TYPE_NI => array( |
35 | - 'singular' => 'MLA', |
|
36 | - 'plural' => 'MLAs' |
|
35 | + 'singular' => 'MLA', |
|
36 | + 'plural' => 'MLAs' |
|
37 | 37 | ), |
38 | 38 | HOUSE_TYPE_SCOTLAND => array( |
39 | - 'singular' => 'MSP', |
|
40 | - 'plural' => 'MSPs' |
|
41 | - ), |
|
39 | + 'singular' => 'MSP', |
|
40 | + 'plural' => 'MSPs' |
|
41 | + ), |
|
42 | 42 | HOUSE_TYPE_LONDON_ASSEMBLY => array( |
43 | - 'singular' => 'Member of the London Assembly', |
|
44 | - 'plural' => 'Members of the London Assembly' |
|
43 | + 'singular' => 'Member of the London Assembly', |
|
44 | + 'plural' => 'Members of the London Assembly' |
|
45 | 45 | ) |
46 | 46 | ); |
47 | 47 |
@@ -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', |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->assertRegexp('#<span class="person-header__about__position__role">\s*Labour\s*MP\s*</span>#', $page); |
35 | 35 | } |
36 | 36 | |
37 | - public function testSittingMLA() |
|
37 | + public function testSittingMLA() |
|
38 | 38 | { |
39 | 39 | $page = $this->fetch_page( array( 'pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla' ) ); |
40 | 40 | $this->assertContains('Test Current-MLA', $page); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | /** |
64 | 64 | * Ensure that the Speaker is given the correct constituency. |
65 | 65 | */ |
66 | - public function testSpeaker() |
|
66 | + public function testSpeaker() |
|
67 | 67 | { |
68 | 68 | $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) ); |
69 | 69 | $this->assertRegexp('#<span class="person-header__about__position__role">\s*Speaker\s*MP\s*</span>#', $page); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/member.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/member.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_page($vars) |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | |
22 | 22 | public function testQueenie() |
23 | 23 | { |
24 | - $page = $this->fetch_page( array( 'representative_type' => 'royal', 'n' => 'elizabeth_the_second' ) ); |
|
24 | + $page = $this->fetch_page(array('representative_type' => 'royal', 'n' => 'elizabeth_the_second')); |
|
25 | 25 | $this->assertContains('Elizabeth the Second', $page); |
26 | 26 | $this->assertContains('Coronated on 2 June 1953', $page); |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testSittingMP() |
30 | 30 | { |
31 | - $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) ); |
|
31 | + $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency')); |
|
32 | 32 | $this->assertContains('Test Current-MP', $page); |
33 | 33 | $this->assertRegexp('#<span class="person-header__about__position__constituency">\s*Test Westminster Constituency\s*</span>#', $page); |
34 | 34 | $this->assertRegexp('#<span class="person-header__about__position__role">\s*Labour\s*MP\s*</span>#', $page); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function testSittingMLA() |
38 | 38 | { |
39 | - $page = $this->fetch_page( array( 'pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla' ) ); |
|
39 | + $page = $this->fetch_page(array('pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla')); |
|
40 | 40 | $this->assertContains('Test Current-MLA', $page); |
41 | 41 | $this->assertRegexp('#<span class="person-header__about__position__constituency">\s*Test Northern Ireland Constituency\s*</span>#', $page); |
42 | 42 | $this->assertRegexp('#<span class="person-header__about__position__role">\s*Sinn Féin\s*MLA\s*</span>#', $page); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function testSittingSinnFeinMP() |
49 | 49 | { |
50 | - $page = $this->fetch_page( array( 'pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency' ) ); |
|
50 | + $page = $this->fetch_page(array('pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency')); |
|
51 | 51 | $this->assertContains('Sinn Féin MPs do not take their seats in Parliament.', $page); |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function testSittingNonSinnFeinMP() |
58 | 58 | { |
59 | - $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) ); |
|
59 | + $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency')); |
|
60 | 60 | $this->assertNotContains('Sinn Féin MPs do not take their seats in Parliament.', $page); |
61 | 61 | } |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function testSpeaker() |
67 | 67 | { |
68 | - $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) ); |
|
68 | + $page = $this->fetch_page(array('pid' => 13, 'url' => '/mp/13/test_speaker/buckingham')); |
|
69 | 69 | $this->assertRegexp('#<span class="person-header__about__position__role">\s*Speaker\s*MP\s*</span>#', $page); |
70 | 70 | } |
71 | 71 | |
@@ -75,25 +75,25 @@ discard block |
||
75 | 75 | # makes sure it is empty in case there's something hanging |
76 | 76 | # about in memcached |
77 | 77 | $banner->set_text(''); |
78 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
78 | + $page = $this->fetch_page(array('url' => '/')); |
|
79 | 79 | $this->assertNotContains('<div class="banner">', $page); |
80 | 80 | $this->assertNotContains('This is a banner', $page); |
81 | 81 | |
82 | 82 | $banner->set_text('This is a banner'); |
83 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
83 | + $page = $this->fetch_page(array('url' => '/')); |
|
84 | 84 | $this->assertContains('This is a banner', $page); |
85 | 85 | |
86 | 86 | $banner->set_text(''); |
87 | - $page = $this->fetch_page( array( 'url' => '/' ) ); |
|
87 | + $page = $this->fetch_page(array('url' => '/')); |
|
88 | 88 | $this->assertNotContains('<div class="banner">', $page); |
89 | 89 | $this->assertNotContains('This is a banner', $page); |
90 | 90 | } |
91 | 91 | |
92 | 92 | public function testNewMPMessage() { |
93 | - $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) ); |
|
93 | + $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency')); |
|
94 | 94 | $this->assertNotContains('is a recently elected MP', $page); |
95 | 95 | $this->db->query('UPDATE member SET entered_house = NOW() WHERE person_id = 17'); |
96 | - $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) ); |
|
96 | + $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency')); |
|
97 | 97 | $this->assertContains('is a recently elected MP', $page); |
98 | 98 | } |
99 | 99 |
@@ -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> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | public $data; |
16 | 16 | |
17 | - private $about_links = array ('help', 'about', 'linktous', 'houserules', 'blog', 'news', 'contact', 'privacy'); |
|
17 | + private $about_links = array('help', 'about', 'linktous', 'houserules', 'blog', 'news', 'contact', 'privacy'); |
|
18 | 18 | private $assemblies_links = array('hansard', 'sp_home', 'ni_home', 'wales_home', 'london_home'); |
19 | 19 | private $international_links = array('newzealand', 'australia', 'ireland', 'mzalendo'); |
20 | 20 | private $tech_links = array('code', 'api', 'data', 'pombola', 'devmailinglist', 'irc'); |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | public function __construct() { |
29 | 29 | $this->data = array(); |
30 | 30 | |
31 | - $this->data['about'] = $this->get_menu_links( $this->about_links ); |
|
32 | - $this->data['assemblies'] = $this->get_menu_links( $this->assemblies_links ); |
|
33 | - $this->data['international'] = $this->get_menu_links( $this->international_links ); |
|
34 | - $this->data['tech'] = $this->get_menu_links( $this->tech_links ); |
|
31 | + $this->data['about'] = $this->get_menu_links($this->about_links); |
|
32 | + $this->data['assemblies'] = $this->get_menu_links($this->assemblies_links); |
|
33 | + $this->data['international'] = $this->get_menu_links($this->international_links); |
|
34 | + $this->data['tech'] = $this->get_menu_links($this->tech_links); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -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 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | Based on postcode <strong><?= $mp_data['postcode'] ?></strong> |
27 | 27 | <a href="<?= $mp_data['change_url'] ?>">(Change postcode)</a> |
28 | 28 | </p> |
29 | - <?php if ( isset( $mp_data ) && $type != 'mlas' ) { ?> |
|
29 | + <?php if (isset($mp_data) && $type != 'mlas') { ?> |
|
30 | 30 | <h3>Your <?= $mp_data['former'] ? $mp_data['former'] . ' ' : '' ?><?= $rep_name ?> is</h3> |
31 | 31 | </div> |
32 | 32 | <a href="<?= $mp_data['mp_url'] ?>" class="people-list__person"> |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | </p> |
39 | 39 | </a> |
40 | 40 | <?php } |
41 | - if ( isset($reps) ) { |
|
42 | - if ( isset($mp_data) && $type != 'mlas' ) { ?> |
|
41 | + if (isset($reps)) { |
|
42 | + if (isset($mp_data) && $type != 'mlas') { ?> |
|
43 | 43 | <div class="people-list__your-mp__replist-header"> |
44 | 44 | <?php } ?> |
45 | 45 | <h3>Your <?=$former ?> <?= $rep_plural == 'MSPs' ? 'regional ' : '' ?><?= $rep_plural ?> are</h3> |
46 | 46 | </div> |
47 | - <?php foreach ( $reps as $rep ) { ?> |
|
47 | + <?php foreach ($reps as $rep) { ?> |
|
48 | 48 | <a href="<?= $rep['mp_url'] ?>" class="people-list__person"> |
49 | 49 | <img class="people-list__person__image" src="<?= $rep['image'] ?>"> |
50 | 50 | <h2 class="people-list__person__name"><?= $rep['name'] ?></h2> |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | <div class="search-page__section search-page__section--search"> |
66 | 66 | <div class="search-page__section__primary"> |
67 | 67 | <p class="search-page-main-inputs"> |
68 | - <?php if ( $type == 'peers' ) { ?> |
|
68 | + <?php if ($type == 'peers') { ?> |
|
69 | 69 | <label for="find-mp-by-name-or-postcode">Find <?= $rep_plural ?> by name:</label> |
70 | - <?php } elseif ( $type == 'mlas' || $type == 'msps' ) { ?> |
|
70 | + <?php } elseif ($type == 'mlas' || $type == 'msps') { ?> |
|
71 | 71 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by postcode:</label> |
72 | 72 | <?php } else { ?> |
73 | 73 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by name or postcode:</label> |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | <div class="search-page__section__primary"> |
109 | 109 | <h2>All <?= $rep_plural ?></h2> |
110 | 110 | |
111 | - <?php if ( $type != 'peers' ) { ?> |
|
111 | + <?php if ($type != 'peers') { ?> |
|
112 | 112 | <ul class="search-result-display-options"> |
113 | - <?php if ( $order == 'given_name' ) { ?> |
|
113 | + <?php if ($order == 'given_name') { ?> |
|
114 | 114 | <li><strong>Sorted by</strong> First name</li> |
115 | 115 | <li>Sort by <a href="<?= $urls['by_last'] ?>">Last name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li> |
116 | - <?php } else if ( $order == 'party' ) { ?> |
|
116 | + <?php } else if ($order == 'party') { ?> |
|
117 | 117 | <li><strong>Sorted by</strong> Party</li> |
118 | 118 | <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_last'] ?>">Last name</a></li> |
119 | 119 | <?php } else { ?> |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | </ul> |
124 | 124 | <?php } else { ?> |
125 | 125 | <ul class="search-result-display-options"> |
126 | - <?php if ( $order == 'party' ) { ?> |
|
126 | + <?php if ($order == 'party') { ?> |
|
127 | 127 | <li><strong>Sorted by</strong> Party</li> |
128 | 128 | <li>Sort by <a href="<?= $urls['by_name'] ?>">Name</a></li> |
129 | 129 | <?php } else { ?> |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | $initial_link = ''; |
176 | - foreach ( $data as $person ) { |
|
176 | + foreach ($data as $person) { |
|
177 | 177 | if ($order != 'party') { |
178 | - $initial = substr( strtoupper($person[$a_to_z_key]), 0, 1); |
|
179 | - if ( $initial != $current_initial ) { |
|
178 | + $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1); |
|
179 | + if ($initial != $current_initial) { |
|
180 | 180 | $current_initial = $initial; |
181 | 181 | $initial_link = "name=\"$initial\" "; |
182 | 182 | } else { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | </noscript> |
191 | 191 | <h2 class="people-list__person__name"><?= ucfirst($person['name']) ?></h2> |
192 | 192 | <p class="people-list__person__memberships"> |
193 | - <?php if ( $person['constituency'] ) { ?> |
|
193 | + <?php if ($person['constituency']) { ?> |
|
194 | 194 | <span class="people-list__person__constituency"><?= $person['constituency'] ?></span> |
195 | 195 | <?php } ?> |
196 | 196 | <span class="people-list__person__party <?= slugify($person['party']) ?>"><?= $person['party'] ?></span> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | <a href="<?= $urls['by_csv'] ?>">Download this list as a CSV</a> |
209 | 209 | suitable for Excel |
210 | 210 | </p> |
211 | - <?php if ( $type == 'mps' ) { ?> |
|
211 | + <?php if ($type == 'mps') { ?> |
|
212 | 212 | <form method="get" action="<?= $urls['plain'] ?>" class="sidebar-item-with-icon sidebar-item-with-icon--date"> |
213 | 213 | <p> |
214 | 214 | Or view a past list |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | }) |
261 | 261 | }); |
262 | 262 | </script> |
263 | - <?php } else if ( $type == 'msps' ) { ?> |
|
263 | + <?php } else if ($type == 'msps') { ?> |
|
264 | 264 | <p class="past-list-dates" id="past-list-dates"> |
265 | 265 | <a href="<?= $urls['plain'] ?>?date=2011-05-05">MSPs at 2011 election</a> |
266 | 266 | <a href="<?= $urls['plain'] ?>?date=2007-05-03">MSPs at 2007 election</a> |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | </p> |
275 | 275 | <?php } ?> |
276 | 276 | |
277 | - <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?> |
|
277 | + <?php include(dirname(__FILE__) . '/../sidebar/looking_for.php') ?> |
|
278 | 278 | </div> |
279 | 279 | </div> |
280 | 280 |
@@ -45,9 +45,9 @@ |
||
45 | 45 | |
46 | 46 | try { |
47 | 47 | $invoice = $sub->latest_invoice; |
48 | - $invoice->pay([ 'expand' => [ 'payment_intent' ] ]); |
|
48 | + $invoice->pay(['expand' => ['payment_intent']]); |
|
49 | 49 | } catch (\Stripe\Error\Card $e) { |
50 | - $invoice = \Stripe\Invoice::retrieve($sub->latest_invoice, ['expand' => [ 'payment_intent'] ]); |
|
50 | + $invoice = \Stripe\Invoice::retrieve($sub->latest_invoice, ['expand' => ['payment_intent']]); |
|
51 | 51 | } |
52 | 52 | } else { |
53 | 53 | $invoice = $subscription->stripe->latest_invoice; |
@@ -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') { |
@@ -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 | } |