Passed
Push — master ( 4c090a...f12e7b )
by Struan
06:21
created
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', 'justice', '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);
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 function person_error_page($message) {
657 657
     global $this_page;
658 658
     $SEARCHURL = '';
659
-    switch($this_page) {
659
+    switch ($this_page) {
660 660
         case 'peer':
661 661
             $people = new MySociety\TheyWorkForYou\People\Peers();
662 662
             $MPSURL = new \MySociety\TheyWorkForYou\Url('peers');
@@ -844,16 +844,16 @@  discard block
 block discarded – undo
844 844
     $recent_speeches = $memcache->get($speeches_key);
845 845
 
846 846
     if (!$recent_speeches) {
847
-        $searchstring_speeches = "speaker:$person_id -section:wrans";  // Exclude written answers section
847
+        $searchstring_speeches = "speaker:$person_id -section:wrans"; // Exclude written answers section
848 848
         $SEARCHENGINE = new \SEARCHENGINE($searchstring_speeches);
849 849
 
850 850
         // Search query excluding written questions
851 851
         $args_speeches = [
852 852
             's' => $searchstring_speeches,
853
-            'p' => 1,                       // First page
854
-            'num' => 8,                     // 8 recent speeches/debates
855
-            'pop' => 1,                     // Disable search logging
856
-            'o' => 'd',                     // Decending by date order
853
+            'p' => 1, // First page
854
+            'num' => 8, // 8 recent speeches/debates
855
+            'pop' => 1, // Disable search logging
856
+            'o' => 'd', // Decending by date order
857 857
         ];
858 858
         $results_speeches = $hansard->search($searchstring_speeches, $args_speeches);
859 859
         $recent_speeches = serialize($results_speeches['rows'] ?? []);
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
     $recent_wrans = $memcache->get($wrans_key);
867 867
 
868 868
     if (!$recent_wrans) {
869
-        $searchstring_wrans = "speaker:$person_id section:wrans";  // Only written answers section
869
+        $searchstring_wrans = "speaker:$person_id section:wrans"; // Only written answers section
870 870
         $SEARCHENGINE = new \SEARCHENGINE($searchstring_wrans);
871 871
 
872 872
         // Search query for written questions only
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
     $lang = LANGUAGE;
1193 1193
 
1194
-    $reg = ['chamber_registers' => [] ];
1194
+    $reg = ['chamber_registers' => []];
1195 1195
 
1196 1196
     foreach ($valid_chambers as $chamber) {
1197 1197
         $key = 'person_regmem_' . $chamber . '_' . $lang;
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
     }
1207 1207
 
1208 1208
     // sort chamber registers by published_date
1209
-    uasort($reg['chamber_registers'], function ($a, $b) {
1209
+    uasort($reg['chamber_registers'], function($a, $b) {
1210 1210
         return $a->published_date <=> $b->published_date;
1211 1211
     });
1212 1212
 
@@ -1300,8 +1300,8 @@  discard block
 block discarded – undo
1300 1300
         }
1301 1301
     }
1302 1302
 
1303
-    foreach($mreg as $reg) {
1304
-        $data['members'][] =  [
1303
+    foreach ($mreg as $reg) {
1304
+        $data['members'][] = [
1305 1305
             'url' => '/' . $rep_type . '/?p=' . $reg['person_id'],
1306 1306
             'name' => $reg['given_name'] . ' ' . $reg['family_name'],
1307 1307
         ];
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.
scripts/alertmailer.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -469,7 +469,7 @@
 block discarded – undo
469 469
 
470 470
     $text .= '====================';
471 471
     $sentemails++;
472
-    mlog("SEND $sentemails : Sending email to $current[email] ... ");
472
+    mlog("send $sentemails : Sending email to $current[email] ... ");
473 473
     $d = ['to' => $current['email'], 'template' => $template];
474 474
     $m = [
475 475
         'DATA' => $text,
Please login to merge, or discard this patch.
scripts/alertgonemps.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,8 @@
 block discarded – undo
166 166
         $success = send_template_email($d, $m, true);
167 167
         mlog("sent ... ");
168 168
         # sleep if time between sending mails is less than a certain number of seconds on average
169
-        if (((time() - $start_time) / $sentemails) < 0.5) { # number of seconds per mail not to be quicker than
169
+        if (((time() - $start_time) / $sentemails) < 0.5) {
170
+# number of seconds per mail not to be quicker than
170 171
             mlog("pausing ... ");
171 172
             sleep(1);
172 173
         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@
 block discarded – undo
154 154
     global $globalsuccess, $sentemails, $nomail, $start_time;
155 155
 
156 156
     $sentemails++;
157
-    mlog("SEND $sentemails : Sending email to $current[email] ... ");
157
+    mlog("send $sentemails : Sending email to $current[email] ... ");
158 158
     $d = ['to' => $current['email'], 'template' => $template];
159 159
     $m = [
160 160
         'DATA' => join("\n", $data),
Please login to merge, or discard this patch.
scripts/mprss.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,8 @@
 block discarded – undo
106 106
     // Write the text to the file...
107 107
     $filename = $rsspath . $person_id . '.rdf';
108 108
     $fh = @fopen($filename, "w");
109
-    if (!$fh) { # Problem writing, just carry on
109
+    if (!$fh) {
110
+# Problem writing, just carry on
110 111
         echo "Could not write to file ($filename)\n";
111 112
         continue;
112 113
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 foreach ($q as $person) {
25 25
     $person_id = $person['person_id'];
26 26
 
27
-    $args =  [ 'person_id' => $person_id ];
27
+    $args = ['person_id' => $person_id];
28 28
     $speeches = $HANSARDLIST->display('person', $args, 'none');
29 29
 
30 30
     // Some data about this person that we'll need for the feed.
Please login to merge, or discard this patch.