Passed
Pull Request — master (#1932)
by Struan
05:36
created
www/docs/admin/websites.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
www/docs/random/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,5 +11,5 @@
 block discarded – undo
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());
Please login to merge, or discard this patch.
www/docs/postcode/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,13 +89,13 @@
 block discarded – undo
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=";
Please login to merge, or discard this patch.
www/docs/mp/index.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
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()) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                 'health', 'education', 'reform', 'home', 'environment',
415 415
                 'transport', 'housing', 'misc',
416 416
             ];
417
-            $sets = array_filter($sets, function ($v) use ($set_descriptions) {
417
+            $sets = array_filter($sets, function($v) use ($set_descriptions) {
418 418
                 return array_key_exists($v, $set_descriptions);
419 419
             });
420 420
             shuffle($sets);
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 function person_error_page($message) {
651 651
     global $this_page;
652 652
     $SEARCHURL = '';
653
-    switch($this_page) {
653
+    switch ($this_page) {
654 654
         case 'peer':
655 655
             $people = new MySociety\TheyWorkForYou\People\Peers();
656 656
             $MPSURL = new \MySociety\TheyWorkForYou\Url('peers');
@@ -838,16 +838,16 @@  discard block
 block discarded – undo
838 838
     $recent_speeches = $memcache->get($speeches_key);
839 839
 
840 840
     if (!$recent_speeches) {
841
-        $searchstring_speeches = "speaker:$person_id -section:wrans";  // Exclude written answers section
841
+        $searchstring_speeches = "speaker:$person_id -section:wrans"; // Exclude written answers section
842 842
         $SEARCHENGINE = new \SEARCHENGINE($searchstring_speeches);
843 843
 
844 844
         // Search query excluding written questions
845 845
         $args_speeches = [
846 846
             's' => $searchstring_speeches,
847
-            'p' => 1,                       // First page
848
-            'num' => 8,                     // 8 recent speeches/debates
849
-            'pop' => 1,                     // Disable search logging
850
-            'o' => 'd',                     // Decending by date order
847
+            'p' => 1, // First page
848
+            'num' => 8, // 8 recent speeches/debates
849
+            'pop' => 1, // Disable search logging
850
+            'o' => 'd', // Decending by date order
851 851
         ];
852 852
         $results_speeches = $hansard->search($searchstring_speeches, $args_speeches);
853 853
         $recent_speeches = serialize($results_speeches['rows'] ?? []);
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
     $recent_wrans = $memcache->get($wrans_key);
861 861
 
862 862
     if (!$recent_wrans) {
863
-        $searchstring_wrans = "speaker:$person_id section:wrans";  // Only written answers section
863
+        $searchstring_wrans = "speaker:$person_id section:wrans"; // Only written answers section
864 864
         $SEARCHENGINE = new \SEARCHENGINE($searchstring_wrans);
865 865
 
866 866
         // Search query for written questions only
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
 
1179 1179
     $lang = LANGUAGE;
1180 1180
 
1181
-    $reg = ['chamber_registers' => [] ];
1181
+    $reg = ['chamber_registers' => []];
1182 1182
 
1183 1183
     foreach ($valid_chambers as $chamber) {
1184 1184
         $key = 'person_regmem_' . $chamber . '_' . $lang;
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
     }
1194 1194
 
1195 1195
     // sort chamber registers by published_date
1196
-    uasort($reg['chamber_registers'], function ($a, $b) {
1196
+    uasort($reg['chamber_registers'], function($a, $b) {
1197 1197
         return $a->published_date <=> $b->published_date;
1198 1198
     });
1199 1199
 
@@ -1287,8 +1287,8 @@  discard block
 block discarded – undo
1287 1287
         }
1288 1288
     }
1289 1289
 
1290
-    foreach($mreg as $reg) {
1291
-        $data['members'][] =  [
1290
+    foreach ($mreg as $reg) {
1291
+        $data['members'][] = [
1292 1292
             'url' => '/' . $rep_type . '/?p=' . $reg['person_id'],
1293 1293
             'name' => $reg['given_name'] . ' ' . $reg['family_name'],
1294 1294
         ];
Please login to merge, or discard this patch.
www/docs/api/api_convertURL.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
www/docs/api/api_getConstituencies.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
www/docs/api/api_getPerson.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
www/docs/calendar/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     foreach ($data['order'] as &$chamber) {
81 81
         if (in_array($chamber['major'] ?? 0, $majors)) {
82 82
             $URL = new \MySociety\TheyWorkForYou\Url($hansardmajors[$chamber['major']]['page_all']);
83
-            $URL->insert([ 'd' => $date ]);
83
+            $URL->insert(['d' => $date]);
84 84
             $chamber['url'] = $URL->generate();
85 85
         }
86 86
     }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     [$firstyear, $firstmonth, $day] = explode('-', $min_future_date);
111 111
     [$finalyear, $finalmonth, $day] = explode('-', $max_future_date);
112 112
 
113
-    $q =  $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
113
+    $q = $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
114 114
         WHERE event_date >= :firstdate
115 115
         AND event_date <= :finaldate
116 116
         AND deleted = 0
Please login to merge, or discard this patch.
www/docs/user/login/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 if (get_http_var("submitted") == "true") {
20 20
     // Form has been submitted, so check input.
21 21
 
22
-    $email 		= get_http_var("email");
22
+    $email = get_http_var("email");
23 23
     $password 	= get_http_var("password");
24 24
     $remember 	= get_http_var("remember");
25 25
 
26 26
     // The user may have tried to do something that requires being logged in.
27 27
     // In which case we should arrive here with that page's URL in 'ret'.
28 28
     // We can then send the user there after log in.
29
-    $returnurl 	= get_http_var("ret");
29
+    $returnurl = get_http_var("ret");
30 30
 
31 31
     $errors = [];
32 32
 
Please login to merge, or discard this patch.