@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | |
19 | 19 | print '<h3>Headline stats</h3> <table>'; |
20 | 20 | $data = [ |
21 | - 'header' => [ 'Alert Type', 'Count' ], |
|
21 | + 'header' => ['Alert Type', 'Count'], |
|
22 | 22 | 'rows' => [ |
23 | - [ 'Confirmed', $q_confirmed ], |
|
24 | - [ 'Not Confirmed', $q_not_confirmed ], |
|
25 | - [ 'Deleted', $q_deleted ], |
|
26 | - [ 'For a Speaker<sup>*</sup>', $q_speaker ], |
|
27 | - [ 'For a Keyword', $q_keyword ], |
|
23 | + ['Confirmed', $q_confirmed], |
|
24 | + ['Not Confirmed', $q_not_confirmed], |
|
25 | + ['Deleted', $q_deleted], |
|
26 | + ['For a Speaker<sup>*</sup>', $q_speaker], |
|
27 | + ['For a Keyword', $q_keyword], |
|
28 | 28 | ], |
29 | 29 | ]; |
30 | 30 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $criteria = $row['criteria']; |
41 | 41 | $rows[] = [$id, $critera]; |
42 | 42 | } |
43 | -$data = [ 'rows' => $rows ]; |
|
43 | +$data = ['rows' => $rows]; |
|
44 | 44 | $PAGE->display_table($data); |
45 | 45 | |
46 | 46 | $q = $db->query('select count(*) as c, criteria from alerts where criteria like "speaker:%" and confirmed and not deleted group by criteria order by c desc'); |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | -$people_header = [ 'Name', 'Confirmed', 'Unconfirmed']; |
|
82 | +$people_header = ['Name', 'Confirmed', 'Unconfirmed']; |
|
83 | 83 | print '<h3>Alert signups by MP/Peer</h3>'; |
84 | 84 | $rows = []; |
85 | 85 | foreach ($tots as $person_id => $c) { |
86 | 86 | $u = $unconfirmed[$person_id] ?? 0; |
87 | - $rows[] = [ $name[$person_id], $c, $u ]; |
|
87 | + $rows[] = [$name[$person_id], $c, $u]; |
|
88 | 88 | } |
89 | 89 | $data = [ |
90 | - 'header' => [ 'Name', 'Confirmed', 'Unconfirmed'], |
|
90 | + 'header' => ['Name', 'Confirmed', 'Unconfirmed'], |
|
91 | 91 | 'rows' => $rows, |
92 | 92 | ]; |
93 | 93 | $PAGE->display_table($data); |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | foreach ($total as $criteria => $tot) { |
115 | 115 | $c = $confirmed[$criteria] ?? 0; |
116 | 116 | $u = $unconfirmed[$criteria] ?? 0; |
117 | - $rows[] = [ $criteria, $c, $u ]; |
|
117 | + $rows[] = [$criteria, $c, $u]; |
|
118 | 118 | } |
119 | 119 | $data = [ |
120 | - 'header' => [ 'Criteria', 'Confirmed', 'Unconfirmed'], |
|
120 | + 'header' => ['Criteria', 'Confirmed', 'Unconfirmed'], |
|
121 | 121 | 'rows' => $rows, |
122 | 122 | ]; |
123 | 123 | $PAGE->display_table($data); |
@@ -125,7 +125,7 @@ |
||
125 | 125 | <select name="sets[]" multiple> |
126 | 126 | <option value="">None</option> |
127 | 127 | <?php |
128 | - $policies = new \MySociety\TheyWorkForYou\Policies(); |
|
128 | + $policies = new \MySociety\TheyWorkForYou\Policies(); |
|
129 | 129 | $set_descriptions = $policies->getSetDescriptions(); |
130 | 130 | $related_sets = $topic->getPolicySets(); |
131 | 131 | foreach ($set_descriptions as $set => $description) { ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $sysretval = 0; |
107 | 107 | $personid = get_http_var('editperson'); |
108 | 108 | |
109 | - $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", [ |
|
109 | + $q = $db->query("DELETE FROM personinfo WHERE data_key = 'mp_website' AND personinfo.person_id = :person_id", [ |
|
110 | 110 | ':person_id' => $personid, |
111 | 111 | ]); |
112 | 112 | |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | |
143 | 143 | $rettext .= '<div id="subnav_websites">'; |
144 | 144 | foreach ($subnav as $label => $path) { |
145 | - $rettext .= '<a href="' . $path . '">' . $label . '</a>'; |
|
145 | + $rettext .= '<a href="' . $path . '">' . $label . '</a>'; |
|
146 | 146 | } |
147 | - $rettext .= '</div>'; |
|
147 | + $rettext .= '</div>'; |
|
148 | 148 | |
149 | 149 | return $rettext; |
150 | 150 | } |
@@ -11,5 +11,5 @@ |
||
11 | 11 | $gid = fix_gid_from_db($gid); |
12 | 12 | |
13 | 13 | $URL = new \MySociety\TheyWorkForYou\Url('debates'); |
14 | -$URL->insert([ 'id' => $gid ]); |
|
14 | +$URL->insert(['id' => $gid]); |
|
15 | 15 | header('Location: ' . $URL->generate()); |
@@ -89,13 +89,13 @@ |
||
89 | 89 | $member_names = \MySociety\TheyWorkForYou\Utility\House::house_to_members($house); |
90 | 90 | if ($house == HOUSE_TYPE_SCOTLAND) { |
91 | 91 | $urlp = 'msp'; |
92 | - $a = [ $areas['SPC'], $areas['SPE'] ]; |
|
92 | + $a = [$areas['SPC'], $areas['SPE']]; |
|
93 | 93 | } elseif ($house == HOUSE_TYPE_WALES) { |
94 | 94 | $urlp = 'ms'; |
95 | - $a = [ $areas['WAC'], $areas['WAE'] ]; |
|
95 | + $a = [$areas['WAC'], $areas['WAE']]; |
|
96 | 96 | } elseif ($house == HOUSE_TYPE_NI) { |
97 | 97 | $urlp = 'mla'; |
98 | - $a = [ $areas['NIE'] ]; |
|
98 | + $a = [$areas['NIE']]; |
|
99 | 99 | } |
100 | 100 | $urlpl = $urlp . 's'; |
101 | 101 | $urlp = "/$urlp/?p="; |
@@ -221,7 +221,7 @@ |
||
221 | 221 | // Basic name, title and description |
222 | 222 | $member_name = ucfirst($MEMBER->full_name()); |
223 | 223 | $title = $member_name; |
224 | -$desc = "Read $member_name's contributions to Parliament, including speeches and questions"; |
|
224 | +$desc = "read $member_name's contributions to Parliament, including speeches and questions"; |
|
225 | 225 | |
226 | 226 | // Enhance description if this is a current member |
227 | 227 | if ($MEMBER->current_member_anywhere()) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | 'health', 'education', 'reform', 'home', 'environment', |
410 | 410 | 'transport', 'housing', 'misc', |
411 | 411 | ]; |
412 | - $sets = array_filter($sets, function ($v) use ($set_descriptions) { |
|
412 | + $sets = array_filter($sets, function($v) use ($set_descriptions) { |
|
413 | 413 | return array_key_exists($v, $set_descriptions); |
414 | 414 | }); |
415 | 415 | shuffle($sets); |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | function person_error_page($message) { |
622 | 622 | global $this_page; |
623 | 623 | $SEARCHURL = ''; |
624 | - switch($this_page) { |
|
624 | + switch ($this_page) { |
|
625 | 625 | case 'peer': |
626 | 626 | $people = new MySociety\TheyWorkForYou\People\Peers(); |
627 | 627 | $MPSURL = new \MySociety\TheyWorkForYou\Url('peers'); |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | $SEARCHENGINE = new \SEARCHENGINE($searchstring); |
808 | 808 | |
809 | 809 | $hansard = new MySociety\TheyWorkForYou\Hansard(); |
810 | - $args = [ |
|
810 | + $args = [ |
|
811 | 811 | 's' => $searchstring, |
812 | 812 | 'p' => 1, |
813 | 813 | 'num' => 3, |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | |
1024 | 1024 | $lang = LANGUAGE; |
1025 | 1025 | |
1026 | - $reg = ['chamber_registers' => [] ]; |
|
1026 | + $reg = ['chamber_registers' => []]; |
|
1027 | 1027 | |
1028 | 1028 | foreach ($valid_chambers as $chamber) { |
1029 | 1029 | $key = 'person_regmem_' . $chamber . '_' . $lang; |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | // sort chamber registers by published_date |
1041 | - uasort($reg['chamber_registers'], function ($a, $b) { |
|
1041 | + uasort($reg['chamber_registers'], function($a, $b) { |
|
1042 | 1042 | return $a->published_date <=> $b->published_date; |
1043 | 1043 | }); |
1044 | 1044 | |
@@ -1132,8 +1132,8 @@ discard block |
||
1132 | 1132 | } |
1133 | 1133 | } |
1134 | 1134 | |
1135 | - foreach($mreg as $reg) { |
|
1136 | - $data['members'][] = [ |
|
1135 | + foreach ($mreg as $reg) { |
|
1136 | + $data['members'][] = [ |
|
1137 | 1137 | 'url' => '/' . $rep_type . '/?p=' . $reg['person_id'], |
1138 | 1138 | 'name' => $reg['given_name'] . ' ' . $reg['family_name'], |
1139 | 1139 | ]; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $LISTURL = new \MySociety\TheyWorkForYou\Url($hansardmajors[$id_data['major']]['page_all']); |
43 | 43 | $fragment = ''; |
44 | 44 | if ($id_data['htype'] == '11' || $id_data['htype'] == '10') { |
45 | - $LISTURL->insert([ 'id' => $id_data['gid'] ]); |
|
45 | + $LISTURL->insert(['id' => $id_data['gid']]); |
|
46 | 46 | } else { |
47 | 47 | $parent_epobject_id = $id_data['subsection_id']; |
48 | 48 | $parent_gid = ''; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $parent_gid = fix_gid_from_db($r['gid']); |
56 | 56 | } |
57 | 57 | if ($parent_gid != '') { |
58 | - $LISTURL->insert([ 'id' => $parent_gid ]); |
|
58 | + $LISTURL->insert(['id' => $parent_gid]); |
|
59 | 59 | $fragment = '#g' . gid_to_anchor($id_data['gid']); |
60 | 60 | } |
61 | 61 | } |
@@ -135,7 +135,7 @@ |
||
135 | 135 | ); |
136 | 136 | } |
137 | 137 | } |
138 | - usort($out, function ($a, $b) { |
|
138 | + usort($out, function($a, $b) { |
|
139 | 139 | if ($a['distance'] > $b['distance']) { |
140 | 140 | return 1; |
141 | 141 | } |
@@ -130,7 +130,7 @@ |
||
130 | 130 | if ($constituencies == 'CONNECTION_TIMED_OUT') { |
131 | 131 | api_error('Connection timed out'); |
132 | 132 | } elseif ($types && isset($constituencies[$types[0]])) { |
133 | - $constituencies = array_map(function ($c) use ($constituencies) { return $constituencies[$c]; }, $types); |
|
133 | + $constituencies = array_map(function($c) use ($constituencies) { return $constituencies[$c]; }, $types); |
|
134 | 134 | _api_getPerson_constituency($constituencies, $house); |
135 | 135 | } elseif ($types && isset($constituencies['WMC'])) { |
136 | 136 | api_error('Postcode not in correct region'); |