Completed
Pull Request — master (#965)
by Nick
05:26
created
www/docs/report/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     if ($COMMENT->exists() == false || !$COMMENT->visible()) {
22 22
         // This comment id didn't exist in the DB.
23
-        trigger_error("There is no annotation with an ID of '" . _htmlentities($comment_id) . "'.", E_USER_NOTICE);
23
+        trigger_error("There is no annotation with an ID of '"._htmlentities($comment_id)."'.", E_USER_NOTICE);
24 24
     }
25 25
 
26 26
     // OK, we've got a valid comment ID.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
             $REPORT = new COMMENTREPORT;
58 58
 
59
-            $reportdata = array (
59
+            $reportdata = array(
60 60
                 'body'		=> get_http_var('body'),
61 61
                 'firstname'	=> get_http_var('firstname'),
62 62
                 'lastname'	=> get_http_var('lastname'),
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
             } else {
87
-                $PAGE->error_message ("Sorry, we were unable to add the report to the database.");
87
+                $PAGE->error_message("Sorry, we were unable to add the report to the database.");
88 88
             }
89 89
         }
90 90
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 
101 101
 
102
-function display_form($COMMENT, $errors=array()) {
102
+function display_form($COMMENT, $errors = array()) {
103 103
     global $this_page, $THEUSER, $PAGE;
104 104
 
105 105
     ?>
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 <?php
123 123
     if ($THEUSER->isloggedin()) {
124 124
         ?>
125
-                <p><br><strong>From:</strong> <?php echo _htmlentities($THEUSER->firstname() . ' ' . $THEUSER->lastname()); ?></p>
125
+                <p><br><strong>From:</strong> <?php echo _htmlentities($THEUSER->firstname().' '.$THEUSER->lastname()); ?></p>
126 126
 <?php
127 127
     } else {
128 128
         // Not-logged-in user, so we want their name and email address.
Please login to merge, or discard this patch.
www/docs/vote/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         voteerror("Your browser must be able to accept cookies before you can register a vote.");
32 32
     } else {
33 33
         // Delete the test cookie.
34
-        setcookie ('testcookie', '');
34
+        setcookie('testcookie', '');
35 35
     }
36 36
     // On with the voting...!
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     // We need to check the user can accept cookies, so...
41 41
 
42 42
     // Set a cookie
43
-    setcookie ('testcookie', 'true');
43
+    setcookie('testcookie', 'true');
44 44
 
45 45
     $ret = get_http_var('ret');
46 46
     $id = get_http_var('id');
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     ));
57 57
 
58 58
     // Redirect to this same URL with 'testing=true' on the end.
59
-    header("Location: " . $URL->generate('none'));
59
+    header("Location: ".$URL->generate('none'));
60 60
     exit;
61 61
 }
62 62
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     $PAGE->page_start();
69 69
 
70
-    $message = array (
70
+    $message = array(
71 71
         'title'	=> 'Sorry',
72 72
         'text'	=> $text
73 73
     );
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         $prev_epvotes[] = $epobject_id;
159 159
         $new_cookie = implode('+', $prev_epvotes);
160 160
 
161
-        setcookie ("epvotes", $new_cookie, time()+60*60*24*365, "/", COOKIEDOMAIN);
161
+        setcookie("epvotes", $new_cookie, time() + 60 * 60 * 24 * 365, "/", COOKIEDOMAIN);
162 162
 
163 163
 
164 164
     } else {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 $PAGE->page_start();
191 191
 
192
-$message = array (
192
+$message = array(
193 193
     'title'	=> "Thanks for your vote",
194 194
     'text'	=> "<strong>Would you like to ask a question like this yourself?</strong> Use our <a href=\"http://www.whatdotheyknow.com\">Freedom of Information site</a>."
195 195
 );
Please login to merge, or discard this patch.
www/docs/email/index.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 $this_page = "emailfriend";
4 4
 
5 5
 include_once '../../includes/easyparliament/init.php';
6
-include_once INCLUDESPATH . 'easyparliament/member.php';
6
+include_once INCLUDESPATH.'easyparliament/member.php';
7 7
 
8 8
 $PAGE->page_start();
9 9
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 if (sizeof($errors)) {
33 33
     print '<p>Please correct the following errors:</p>';
34
-    print '<ul><li>' . join('</li> <li>', $errors) . '</li></ul><br>';
34
+    print '<ul><li>'.join('</li> <li>', $errors).'</li></ul><br>';
35 35
 ?>
36 36
 <form action="./" method="post">
37 37
 <p>
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 <?php
46 46
 } else {
47 47
     $rep_name = $MEMBER->full_name();
48
-    if ($MEMBER->house_disp==1) $rep_name .= ' MP';
49
-    elseif ($MEMBER->house_disp==3) $rep_name .= ' MLA';
50
-    $data = array (
48
+    if ($MEMBER->house_disp == 1) $rep_name .= ' MP';
49
+    elseif ($MEMBER->house_disp == 3) $rep_name .= ' MLA';
50
+    $data = array(
51 51
         'template'      => 'email_a_friend',
52 52
         'to'            => $recipient_email,
53
-        'subject'       => 'Find out all about ' . $rep_name
53
+        'subject'       => 'Find out all about '.$rep_name
54 54
     );
55 55
     $url = $MEMBER->url(true);
56
-    $merge = array (
56
+    $merge = array(
57 57
         'NAME' => $sender_name,
58 58
         'EMAIL' => $sender_email,
59 59
         'REP_NAME' => $rep_name,
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,20 +14,25 @@  discard block
 block discarded – undo
14 14
 $sender_email = get_http_var('sender_mail');
15 15
 $sender_name = get_http_var('sender_name');
16 16
 $pid = intval(get_http_var('pid'));
17
-if ($pid)
17
+if ($pid) {
18 18
     $MEMBER = new MEMBER(array('person_id' => $pid));
19
+}
19 20
 
20 21
 //validate them
21 22
 $errors = array();
22 23
 
23
-if (!$pid)
24
+if (!$pid) {
24 25
     $errors[] = 'You did not get to this page from an MP or Peer page. Please go back and try again.';
25
-if (!preg_match('#^[^@]+@#', $recipient_email))
26
+}
27
+if (!preg_match('#^[^@]+@#', $recipient_email)) {
26 28
     $errors[] = "'$recipient_email' is not a valid recipient email address. Please have another go.";
27
-if (!validate_email($sender_email))
29
+}
30
+if (!validate_email($sender_email)) {
28 31
     $errors[] = "'$sender_email' is not a valid sender email address. Please have another go.";
29
-if (!$sender_name)
32
+}
33
+if (!$sender_name) {
30 34
     $errors[] = "If you don't give us your name, we can't tell the recipient who sent them the link. We won't store it or use for any other purpose than sending this email.";
35
+}
31 36
 
32 37
 if (sizeof($errors)) {
33 38
     print '<p>Please correct the following errors:</p>';
@@ -45,8 +50,11 @@  discard block
 block discarded – undo
45 50
 <?php
46 51
 } else {
47 52
     $rep_name = $MEMBER->full_name();
48
-    if ($MEMBER->house_disp==1) $rep_name .= ' MP';
49
-    elseif ($MEMBER->house_disp==3) $rep_name .= ' MLA';
53
+    if ($MEMBER->house_disp==1) {
54
+        $rep_name .= ' MP';
55
+    } elseif ($MEMBER->house_disp==3) {
56
+        $rep_name .= ' MLA';
57
+    }
50 58
     $data = array (
51 59
         'template'      => 'email_a_friend',
52 60
         'to'            => $recipient_email,
Please login to merge, or discard this patch.
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&rsquo;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&rsquo;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&rsquo;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&rsquo;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&rsquo;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.