Passed
Pull Request — master (#1389)
by Struan
32:19
created
www/docs/foiorder2009/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 $PAGE->page_start();
9 9
 $PAGE->stripe_start();
10
-$PAGE->block_start(array ('id'=>'intro', 'title'=>'We need your help:'));
10
+$PAGE->block_start(array('id'=>'intro', 'title'=>'We need your help:'));
11 11
 
12 12
 echo '<div id="foi2009">';
13 13
 echo $foi2009_message;
Please login to merge, or discard this patch.
www/docs/rss/index.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     } elseif ($constituency == "") {
15 15
             $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode";
16 16
             twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
17
-       } else {
17
+        } else {
18 18
             $MEMBER = new MEMBER(array('constituency' => $constituency));
19 19
             if ($MEMBER->person_id()) {
20 20
                 // This will cookie the postcode.
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
 
6 6
 $pc = get_http_var('pc');
7 7
 $pc = preg_replace('#[^a-z0-9 ]#i', '', $pc);
8
-if (!$pc) exit;
8
+if (!$pc) {
9
+    exit;
10
+}
9 11
 
10 12
 if (validate_postcode($pc)) {
11 13
     $constituency = strtolower(MySociety\TheyWorkForYou\Utility\Postcode::postcodeToConstituency($pc));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once INCLUDESPATH."easyparliament/member.php";
4
+include_once INCLUDESPATH . "easyparliament/member.php";
5 5
 
6 6
 $pc = get_http_var('pc');
7 7
 $pc = preg_replace('#[^a-z0-9 ]#i', '', $pc);
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
             $errors['pc'] = "Sorry, we couldn't check your postcode right now. Please use the 'All Mps' link above to browse MPs";
14 14
     } elseif ($constituency == "") {
15 15
             $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode";
16
-            twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
16
+            twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
17 17
        } else {
18 18
             $MEMBER = new MEMBER(array('constituency' => $constituency));
19 19
             if ($MEMBER->person_id()) {
@@ -27,5 +27,5 @@  discard block
 block discarded – undo
27 27
         }
28 28
     } else {
29 29
         $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a valid postcode";
30
-        twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form.");
30
+        twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form.");
31 31
     }
Please login to merge, or discard this patch.
www/docs/freeourbills/doshare.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     <?php
17 17
 }
18 18
 
19
-$PAGE->block_start(array ('title'=>'Share the \'Free our Bills!\' campaign'));
19
+$PAGE->block_start(array('title'=>'Share the \'Free our Bills!\' campaign'));
20 20
 freeourbills_styles();
21 21
 
22 22
 freeourbills_share_page();
@@ -25,4 +25,4 @@  discard block
 block discarded – undo
25 25
 
26 26
 $PAGE->block_end();
27 27
 $PAGE->stripe_end();
28
-$PAGE->page_end ();
28
+$PAGE->page_end();
Please login to merge, or discard this patch.
www/docs/freeourbills/techy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,4 +144,4 @@
 block discarded – undo
144 144
 <?php
145 145
 #$PAGE->block_end();
146 146
 $PAGE->stripe_end();
147
-$PAGE->page_end ();
147
+$PAGE->page_end();
Please login to merge, or discard this patch.
www/docs/freeourbills/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,4 +138,4 @@
 block discarded – undo
138 138
     'type' => 'html',
139 139
     'content' => '<p align="center"><img title="Duck-billed platypus" src="bill3.jpg" alt="" hspace="10"></p>'
140 140
 )));
141
-$PAGE->page_end ();
141
+$PAGE->page_end();
Please login to merge, or discard this patch.
www/docs/alert/authed.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 $email = get_http_var('email');
17 17
 $sign = get_http_var('sign');
18 18
 $pid = get_http_var('pid');
19
-if (!$pid || !ctype_digit($pid)) print 'not valid';
20
-else {
19
+if (!$pid || !ctype_digit($pid)) {
20
+    print 'not valid';
21
+} else {
21 22
     $authed = auth_verify_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET, $sign);
22 23
     if ($authed) {
23 24
         $db = new ParlDB;
@@ -26,10 +27,11 @@  discard block
 block discarded – undo
26 27
             ':criteria' => 'speaker:' . $pid
27 28
             ));
28 29
         $already_signed = $q->rows();
29
-        if ($already_signed)
30
-            print "already signed";
31
-        else
32
-            print "not signed";
30
+        if ($already_signed) {
31
+                    print "already signed";
32
+        } else {
33
+                    print "not signed";
34
+        }
33 35
     } else {
34 36
         print "not authed";
35 37
     }
Please login to merge, or discard this patch.
www/docs/regmem/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 rsort($files);
14 14
 
15 15
 if (!DEVSITE) {
16
-   header('Cache-Control: max-age=3600');
16
+    header('Cache-Control: max-age=3600');
17 17
 }
18 18
 
19 19
 $PAGE->page_start();
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $file = file_get_contents($_);
68 68
         $date = preg_replace("#$dir/regmem(.*?)\.xml#", '$1', $_);
69 69
         $data[$_] = array();
70
-        if (preg_match('#<regmem personid="uk.org.publicwhip/person/'.$p.'" (?:memberid="(.*?)" )?membername="(.*?)" date="(.*?)">(.*?)</regmem>#s', $file, $m)) {
70
+        if (preg_match('#<regmem personid="uk.org.publicwhip/person/' . $p . '" (?:memberid="(.*?)" )?membername="(.*?)" date="(.*?)">(.*?)</regmem>#s', $file, $m)) {
71 71
             $earliest = $_;
72 72
             if (!$name) {
73 73
                 $name = $m[2];
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
             break;
104 104
         }
105 105
         $date_pre = preg_replace("#$dir/regmem(.*?)\.xml#", '$1', $_);
106
-        $date_post = preg_replace("#$dir/regmem(.*?)\.xml#", '$1', $files[$i+1]);
106
+        $date_post = preg_replace("#$dir/regmem(.*?)\.xml#", '$1', $files[$i + 1]);
107 107
         $pretty = format_date($date_pre, LONGDATEFORMAT);
108 108
         $oout = '';
109 109
         foreach ($data[$_] as $cat_type => $cat_data) {
110
-            $old = array_key_exists($cat_type, $data[$files[$i+1]]) ? $data[$files[$i+1]][$cat_type] : '';
110
+            $old = array_key_exists($cat_type, $data[$files[$i + 1]]) ? $data[$files[$i + 1]][$cat_type] : '';
111 111
             $new = $data[$_][$cat_type];
112 112
             if ($diff = clean_diff($old, $new)) {
113 113
                 $oout .= cat_heading($cat_type, $date_pre, $date_post) . $diff;
114 114
             }
115 115
         }
116
-        foreach ($data[$files[$i+1]] as $cat_type => $cat_data) {
116
+        foreach ($data[$files[$i + 1]] as $cat_type => $cat_data) {
117 117
             if (array_key_exists($cat_type, $data[$_])) {
118 118
                 continue;
119 119
             }
120
-            if ($diff = clean_diff($data[$files[$i+1]][$cat_type], '')) {
120
+            if ($diff = clean_diff($data[$files[$i + 1]][$cat_type], '')) {
121 121
                 $oout .= cat_heading($cat_type, $date_pre, $date_post) . $diff;
122 122
             }
123 123
         }
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
     if ($f) {
150 150
         $f = "$dir/regmem$f.xml";
151 151
         $count = count($files);
152
-        for ($i=0; $i<$count; ++$i) {
152
+        for ($i = 0; $i < $count; ++$i) {
153 153
             if ($files[$i] == $f) {
154 154
                 $new = $i;
155 155
                 break;
156 156
             }
157 157
         }
158 158
     }
159
-    $old = $new+1;
159
+    $old = $new + 1;
160 160
     $old = $files[$old];
161 161
     $old_iso = preg_replace("#$dir/regmem(.*?)\.xml#", '$1', $old);
162 162
     $old_pretty = format_date($old_iso, LONGDATEFORMAT);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     $old = file_get_contents($old);
167 167
     $new = file_get_contents($new);
168 168
 
169
-    $DATA->set_page_metadata($this_page, 'heading', 'Changes from '.$old_pretty.' to '.$new_pretty);
169
+    $DATA->set_page_metadata($this_page, 'heading', 'Changes from ' . $old_pretty . ' to ' . $new_pretty);
170 170
     $PAGE->stripe_start();
171 171
     print $link;
172 172
     $data = array();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $out .= clean_diff($old, $new);
189 189
         }
190 190
         if ($out) {
191
-            print span_row('<h2>'.$names[$person_id].' - <a href="?p='.$person_id.'">Register history</a> | <a href="/mp/?pid='.$person_id.'">MP&rsquo;s page</a></h2>', true) . $out;
191
+            print span_row('<h2>' . $names[$person_id] . ' - <a href="?p=' . $person_id . '">Register history</a> | <a href="/mp/?pid=' . $person_id . '">MP&rsquo;s page</a></h2>', true) . $out;
192 192
         }
193 193
     }
194 194
     print '</table>';
@@ -239,28 +239,28 @@  discard block
 block discarded – undo
239 239
     $c = 0; $year = 0;
240 240
     $view = ''; $compare = '';
241 241
     $count = count($files);
242
-    for ($i=0; $i<$count; ++$i) {
242
+    for ($i = 0; $i < $count; ++$i) {
243 243
         preg_match('/(\d\d\d\d)-(\d\d-\d\d)/', $files[$i], $m);
244 244
         $y = $m[1]; $md = $m[2];
245 245
         if ($c++) {
246 246
             $view .= ' | ';
247
-            if ($i < $count-1) {
247
+            if ($i < $count - 1) {
248 248
                 $compare .= ' | ';
249 249
             }
250 250
         }
251 251
         if ($year != $y) {
252 252
             $year = $y;
253 253
             $view .= "<em>$year</em> ";
254
-            if ($i < $count-1) {
254
+            if ($i < $count - 1) {
255 255
                 $compare .= "<em>$year</em> ";
256 256
             }
257 257
         }
258 258
         $months = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
259 259
         preg_match('/(\d\d)-(\d\d)/', $md, $m);
260
-        $date = ($m[2]+0) . ' '. $months[$m[1]-1];
261
-        $view .= '<a href="./?d='.$y.'-'.$md.'">'.$date.'</a>';
262
-        if ($i < $count-1) {
263
-            $compare .= '<a href="?f='.$y.'-'.$md.'">'.$date.'</a>';
260
+        $date = ($m[2] + 0) . ' ' . $months[$m[1] - 1];
261
+        $view .= '<a href="./?d=' . $y . '-' . $md . '">' . $date . '</a>';
262
+        if ($i < $count - 1) {
263
+            $compare .= '<a href="?f=' . $y . '-' . $md . '">' . $date . '</a>';
264 264
         }
265 265
     }
266 266
 ?>
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 <?php
277 277
     uasort($names, 'by_name');
278 278
     foreach ($names as $_ => $value) {
279
-        print '<li><a href="?p='.$_.'">'.$value.'</a>';
279
+        print '<li><a href="?p=' . $_ . '">' . $value . '</a>';
280 280
     }
281 281
     print '</ul>';
282 282
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     $data = array();
295 295
     parse_file($d, $d_iso, 'only', $data);
296 296
     $this_page = 'regmem_date';
297
-    $DATA->set_page_metadata($this_page, 'heading', "The Register of Members' Interests, $d_pretty");;
297
+    $DATA->set_page_metadata($this_page, 'heading', "The Register of Members' Interests, $d_pretty"); ;
298 298
     $PAGE->stripe_start();
299 299
     print $link;
300 300
 ?>
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         foreach ($v as $cat_type => $vv) {
309 309
             $out .= cat_heading($cat_type, $d_iso, $d_iso, false);
310 310
             $d = (array_key_exists('only', $data[$person_id][$cat_type]) ? $data[$person_id][$cat_type]['only'] : '');
311
-            $out .= prettify($d)."\n";
311
+            $out .= prettify($d) . "\n";
312 312
         }
313 313
         if ($out) {
314 314
             print '<div class="block">';
@@ -359,8 +359,8 @@  discard block
 block discarded – undo
359 359
     if (!count($r) && !count($a)) {
360 360
         return '';
361 361
     }
362
-    $r = join("\n", $r); $r = $r ? '<td class="r"><ul>'.$r.'</ul></td>' : '<td>&nbsp;</td>';
363
-    $a = join("\n", $a); $a = $a ? '<td class="a"><ul>'.$a.'</ul></td>' : '<td>&nbsp;</td>';
362
+    $r = join("\n", $r); $r = $r ? '<td class="r"><ul>' . $r . '</ul></td>' : '<td>&nbsp;</td>';
363
+    $a = join("\n", $a); $a = $a ? '<td class="a"><ul>' . $a . '</ul></td>' : '<td>&nbsp;</td>';
364 364
     $diff = '<tr>' . $r . $a . '</tr>';
365 365
     $diff = preg_replace('#<item.*?>(.*?)</item>#', '<li>$1</li>', $diff);
366 366
     return $diff;
Please login to merge, or discard this patch.
www/docs/search/rss/index.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,9 @@
 block discarded – undo
44 44
         $pagetitle .= " page $pagenum";
45 45
     }
46 46
     $num = get_http_var('n');
47
-    if (!is_numeric($num) || $num <= 0)
48
-        $num = 20;
47
+    if (!is_numeric($num) || $num <= 0) {
48
+            $num = 20;
49
+    }
49 50
 
50 51
     $DATA->set_page_metadata($this_page, 'title', $pagetitle);
51 52
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 # vim:sw=4:ts=4:et:nowrap
3 3
 
4 4
 include_once '../../../includes/easyparliament/init.php';
5
-include_once INCLUDESPATH."easyparliament/member.php";
6
-include_once INCLUDESPATH."easyparliament/glossary.php";
5
+include_once INCLUDESPATH . "easyparliament/member.php";
6
+include_once INCLUDESPATH . "easyparliament/glossary.php";
7 7
 
8 8
 if (!DEVSITE) {
9 9
     header('Cache-Control: max-age=86400'); # Once a day
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     $DATA->set_page_metadata($this_page, 'title', $pagetitle);
51 51
 
52
-    $args = array (
52
+    $args = array(
53 53
         's' => $searchstring,
54 54
         'p' => $pagenum,
55 55
         'pop' => 1,
Please login to merge, or discard this patch.
www/docs/hansardbugs/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@  discard block
 block discarded – undo
2 2
 
3 3
 $this_page = 'hansard_bugs';
4 4
 include_once '../../includes/easyparliament/init.php';
5
-$DATA->set_page_metadata($this_page, 'heading','Official Hansard problems');
5
+$DATA->set_page_metadata($this_page, 'heading', 'Official Hansard problems');
6 6
 
7 7
 $PAGE->page_start();
8 8
 $PAGE->stripe_start();
9 9
 
10
-$PAGE->block_start(array ('title'=>'Things currently noticeable to the user'));
10
+$PAGE->block_start(array('title'=>'Things currently noticeable to the user'));
11 11
 ?>
12 12
 
13 13
 <style type="text/css">
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 <?php
112 112
 $PAGE->block_end();
113
-$PAGE->block_start(array ('title'=>'Things not noticeable to the user'));
113
+$PAGE->block_start(array('title'=>'Things not noticeable to the user'));
114 114
 ?>
115 115
 
116 116
 <ul>
Please login to merge, or discard this patch.