Completed
Pull Request — master (#1322)
by Nick
07:54 queued 02:46
created
www/docs/calendar/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         }
63 63
     }
64 64
 
65
-    include_once INCLUDESPATH . 'easyparliament/templates/html/calendar_date.php';
65
+    include_once INCLUDESPATH.'easyparliament/templates/html/calendar_date.php';
66 66
 }
67 67
 
68 68
 # ---
Please login to merge, or discard this patch.
www/docs/topic/topic.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $divisions = new Divisions();
43 43
         $data['recent_divisions'] = $divisions->getRecentDivisionsForPolicies($topic_policies, 10);
44 44
 
45
-        include_once INCLUDESPATH . 'easyparliament/member.php';
45
+        include_once INCLUDESPATH.'easyparliament/member.php';
46 46
 
47 47
         // Check to see if there's a submitted postcode to try determine policy positions.
48 48
         if (get_http_var('pc') != '')
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
                 $pc = get_http_var('pc');
55 55
                 $pc = preg_replace('#[^a-z0-9]#i', '', $pc);
56 56
                 if (validate_postcode($pc)) {
57
-                    twfy_debug ('MP', "MP lookup by postcode");
57
+                    twfy_debug('MP', "MP lookup by postcode");
58 58
                     $constituency = strtolower(Utility\Postcode::postcodeToConstituency($pc));
59 59
                     if ($constituency == "connection_timed_out") {
60 60
                         throw new Exception('Sorry, we couldn’t check your postcode right now, as our postcode lookup server is under quite a lot of load.');
61 61
                     } elseif ($constituency == "") {
62
-                        twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
63
-                        throw new Exception('Sorry, ' . _htmlentities($pc) . ' isn’t a known postcode');
62
+                        twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
63
+                        throw new Exception('Sorry, '._htmlentities($pc).' isn’t a known postcode');
64 64
                     } else {
65 65
                         // Generate the Member object
66 66
                         $member = new Member(array('constituency' => $constituency, 'house' => HOUSE_TYPE_COMMONS));
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
                         }
71 71
                     }
72 72
                 } else {
73
-                    twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form.");
74
-                    throw new Exception('Sorry, ' . _htmlentities($pc) . ' isn’t a valid postcode');
73
+                    twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form.");
74
+                    throw new Exception('Sorry, '._htmlentities($pc).' isn’t a valid postcode');
75 75
                 }
76 76
             } catch (Exception $e) {
77 77
                 Renderer::output('topic/error', array('error' => $e->getMessage()));
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 namespace MySociety\TheyWorkForYou;
12 12
 
13 13
 // Disable the old PAGE class.
14
-$new_style_template = TRUE;
14
+$new_style_template = true;
15 15
 
16 16
 // Include all the things this page needs.
17 17
 include_once '../../includes/easyparliament/init.php';
Please login to merge, or discard this patch.
www/docs/mps/multiple.php 2 patches
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
 $db = new ParlDB();
7 7
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     from member as m1, member as m2
13 13
     where m1.person_id = m2.person_id and m1.house != m2.house and m1.house < m2.house
14 14
         and m1.left_house='9999-12-31' and m2.left_house='9999-12-31'");
15
-for ($i=0; $i<$q->rows(); $i++) {
15
+for ($i = 0; $i < $q->rows(); $i++) {
16 16
     $pid = $q->field($i, 'person_id');
17 17
     $member = new MEMBER(array('person_id' => $pid));
18 18
     $h1 = $q->field($i, 'house1');
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     if (!isset($out[$h1][$h2])) return;
32 32
     print "<h3>$title</h3>\n<ul>\n";
33 33
     foreach ($out[$h1][$h2] as $m) {
34
-        print '<li><a href="' . $m->url() . '">' . $m->full_name() . "</a></li>\n";
34
+        print '<li><a href="'.$m->url().'">'.$m->full_name()."</a></li>\n";
35 35
     }
36 36
     print '</ul>';
37 37
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@
 block discarded – undo
28 28
 
29 29
 function out($h1, $h2, $title) {
30 30
     global $out;
31
-    if (!isset($out[$h1][$h2])) return;
31
+    if (!isset($out[$h1][$h2])) {
32
+        return;
33
+    }
32 34
     print "<h3>$title</h3>\n<ul>\n";
33 35
     foreach ($out[$h1][$h2] as $m) {
34 36
         print '<li><a href="' . $m->url() . '">' . $m->full_name() . "</a></li>\n";
Please login to merge, or discard this patch.
www/docs/mps/speaker09.php 2 patches
Spacing   +4 added lines, -4 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
 $db = new ParlDB();
7 7
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     where personinfo.person_id=member.person_id and left_house='$left_house'
51 51
     and data_key='speaker_candidate_contacted_on'");
52 52
 $pids = array();
53
-for ($i=0; $i<$q->rows(); $i++) {
53
+for ($i = 0; $i < $q->rows(); $i++) {
54 54
     $pid = $q->field($i, 'person_id');
55 55
     $pids[] = $pid;
56 56
     $member[$pid] = new MEMBER(array('person_id' => $pid));
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
     order by data_key desc");
64 64
 echo '<table>';
65 65
 $oldpid = null;
66
-for ($i=0; $i<$q->rows(); $i++) {
66
+for ($i = 0; $i < $q->rows(); $i++) {
67 67
     $pid = $q->field($i, 'person_id');
68 68
     $value = $q->field($i, 'data_value');
69 69
     $key = $q->field($i, 'data_key');
70 70
     if ($pid != $oldpid) {
71 71
         if ($oldpid) print "</tr>\n";
72
-        print '<tr><th align="left"><a href="' . $member[$pid]->url() . '">' . $member[$pid]->full_name() . '</a></th>';
72
+        print '<tr><th align="left"><a href="'.$member[$pid]->url().'">'.$member[$pid]->full_name().'</a></th>';
73 73
         $oldpid = $pid;
74 74
     }
75 75
     if ($key == 'speaker_candidate_response_summary') {
Please login to merge, or discard this patch.
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@  discard block
 block discarded – undo
68 68
     $value = $q->field($i, 'data_value');
69 69
     $key = $q->field($i, 'data_key');
70 70
     if ($pid != $oldpid) {
71
-        if ($oldpid) print "</tr>\n";
71
+        if ($oldpid) {
72
+            print "</tr>\n";
73
+        }
72 74
         print '<tr><th align="left"><a href="' . $member[$pid]->url() . '">' . $member[$pid]->full_name() . '</a></th>';
73 75
         $oldpid = $pid;
74 76
     }
@@ -81,10 +83,11 @@  discard block
 block discarded – undo
81 83
             echo "<td>No response ";
82 84
         }
83 85
     } else {
84
-        if ($value)
85
-            echo "(and <strong>was</strong> a candidate for speaker).</td>";
86
-        else
87
-            echo "(but <strong>was not</strong> a candidate for speaker).</td>";
86
+        if ($value) {
87
+                    echo "(and <strong>was</strong> a candidate for speaker).</td>";
88
+        } else {
89
+                    echo "(but <strong>was not</strong> a candidate for speaker).</td>";
90
+        }
88 91
     }
89 92
 }
90 93
 
Please login to merge, or discard this patch.
www/docs/mps/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 $args = $people->getArgs();
19 19
 $people->setMetaData($args);
20 20
 $data = $people->getData($args);
21
-if ( isset($args['f']) && $args['f'] == 'csv' ) {
21
+if (isset($args['f']) && $args['f'] == 'csv') {
22 22
     $people->sendAsCSV($data);
23 23
 } else {
24 24
     MySociety\TheyWorkForYou\Renderer::output("people/index", $data);
Please login to merge, or discard this patch.
www/docs/parliament/index.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 $DATA->set_page_metadata($this_page, 'title', 'Parliament');
8 8
 $DATA->set_page_metadata($this_page, 'meta_description',
9
-             'What goes on in Parliament? Up-to-the-minute records on all MPs, debates, speeches and statements from the House of Commons, House of Lords, Scottish Parliament, and Northern Ireland Assembly.');
9
+                'What goes on in Parliament? Up-to-the-minute records on all MPs, debates, speeches and statements from the House of Commons, House of Lords, Scottish Parliament, and Northern Ireland Assembly.');
10 10
 $DATA->set_page_metadata($this_page, 'meta_keywords', 'parliament, uk parliament, parliamentary, house of commons, house commons, house of lords, house lords, house of parliament, parliment, houses parliament, parliament uk, member of parliament, welsh assembly, scottish parliament, the parliament, house of parliment, houses of parliment, parliment uk, uk parliment, houses of parliament, parliament houses, parliament of uk, parliament in uk, the house of parliament, scottish parliment, members of parliament, parliament members, scotish parliament, parliament scottish, the house of commons, british parliament, what is parliament, the house of lords, the scottish parliament, london parliament, parliament london, the houses of parliament, english parliament, northern ireland parliament, the british parliament, northern ireland assembly, history of parliament, parliament history, parliament of england, england parliament');
11 11
 
12 12
 $PAGE->supress_heading = true;
Please login to merge, or discard this patch.
www/docs/news/sidebar_archives.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     $ym = substr($date, 0, 7);
14 14
     if ($ym != $last) {
15
-        $url = WEBPATH . "news/archives/".str_replace("-", "/", $ym);
15
+        $url = WEBPATH."news/archives/".str_replace("-", "/", $ym);
16 16
         print "<a href=\"$url\">".format_date($ym."-01", "F Y")."</a>";
17 17
         print "<br>";
18 18
         $last = $ym;
Please login to merge, or discard this patch.
www/docs/news/home_page_include.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     if ($c++ == 2) break;
11 11
     list($title, $content, $date) = $news_row;
12 12
     $url = news_individual_link($date, $title);
13
-    print "<h5><a href=\"$url\">" . $title . "</a></h5>";
13
+    print "<h5><a href=\"$url\">".$title."</a></h5>";
14 14
     print "<p>";
15 15
     print trim_characters(news_format_body($content), 0, 250);
16 16
     print " <a href=\"$url\">Read more...</a>";
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@
 block discarded – undo
7 7
 
8 8
 $c = 0;
9 9
 foreach ($all_news as $id => $news_row) {
10
-    if ($c++ == 2) break;
10
+    if ($c++ == 2) {
11
+        break;
12
+    }
11 13
     list($title, $content, $date) = $news_row;
12 14
     $url = news_individual_link($date, $title);
13 15
     print "<h5><a href=\"$url\">" . $title . "</a></h5>";
Please login to merge, or discard this patch.
www/docs/news/rdf.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 header('Content-type: application/rss+xml');
3
-include ($_SERVER['DOCUMENT_ROOT'] . '/../includes/easyparliament/init.php');
3
+include ($_SERVER['DOCUMENT_ROOT'].'/../includes/easyparliament/init.php');
4 4
 require_once 'editme.php';
5 5
 print '<?xml version="1.0" encoding="utf-8"?>' ?>
6 6
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         list($title, $content, $date) = $news_row;
44 44
         $url = "https://www.theyworkforyou.com".news_individual_link($date, $title);
45 45
         $excerpt = trim_characters(news_format_body($content), 0, 250);
46
-        $date = str_replace(" ", "T", $date) . "+00:00";
46
+        $date = str_replace(" ", "T", $date)."+00:00";
47 47
 ?>
48 48
 <item rdf:about="<?=$url?>">
49 49
 <title><?=_htmlspecialchars($title)?></title>
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 <?php
26 26
     $c = 0;
27 27
     foreach ($all_news as $id => $news_row) {
28
-        if ($c++ == 10) break;
28
+        if ($c++ == 10) {
29
+            break;
30
+        }
29 31
         list($title, $content, $date) = $news_row;
30 32
         $url = "https://www.theyworkforyou.com".news_individual_link($date, $title);
31 33
         print "<rdf:li rdf:resource=\"$url\" />\n";
@@ -39,7 +41,9 @@  discard block
 block discarded – undo
39 41
 <?php
40 42
     $c = 0;
41 43
     foreach ($all_news as $id => $news_row) {
42
-        if ($c++ == 10) break;
44
+        if ($c++ == 10) {
45
+            break;
46
+        }
43 47
         list($title, $content, $date) = $news_row;
44 48
         $url = "https://www.theyworkforyou.com".news_individual_link($date, $title);
45 49
         $excerpt = trim_characters(news_format_body($content), 0, 250);
Please login to merge, or discard this patch.