Completed
Pull Request — master (#1324)
by Nick
10:37 queued 04:52
created
www/includes/easyparliament/comment.php 4 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,8 +210,8 @@
 block discarded – undo
210 210
                             array(':epobject_id' => $this->epobject_id));
211 211
 
212 212
             if ($q->rows() > 0) {
213
-                 // If you change stuff here, you might have to change it in
214
-                 // $COMMENTLIST->_get_comment_data() too...
213
+                    // If you change stuff here, you might have to change it in
214
+                    // $COMMENTLIST->_get_comment_data() too...
215 215
 
216 216
                 $gid = fix_gid_from_db($q->field(0, 'gid')); // In includes/utility.php
217 217
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public $body = '';
32 32
     public $posted = '';
33 33
     public $visible = false;
34
-    public $modflagged = NULL;	// Is a datetime when set.
34
+    public $modflagged = null;	// Is a datetime when set.
35 35
     public $firstname = '';	// Of the person who posted it.
36 36
     public $lastname = '';
37 37
     public $url = '';
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $flag = "'$date'";
139 139
 
140 140
         } elseif ($switch == 'off') {
141
-            $date = NULL;
141
+            $date = null;
142 142
             $flag = 'NULL';
143 143
 
144 144
         } else {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
     public $body = '';
32 32
     public $posted = '';
33 33
     public $visible = false;
34
-    public $modflagged = NULL;	// Is a datetime when set.
35
-    public $firstname = '';	// Of the person who posted it.
34
+    public $modflagged = NULL; // Is a datetime when set.
35
+    public $firstname = ''; // Of the person who posted it.
36 36
     public $lastname = '';
37 37
     public $url = '';
38 38
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public $exists = false;
42 42
 
43 43
 
44
-    public function __construct($comment_id='') {
44
+    public function __construct($comment_id = '') {
45 45
 
46 46
         $this->db = new ParlDB;
47 47
 
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
             if ($q->rows() > 0) {
70 70
 
71 71
                 $this->comment_id 	= $comment_id;
72
-                $this->user_id		= $q->field(0, 'user_id');
72
+                $this->user_id = $q->field(0, 'user_id');
73 73
                 $this->epobject_id	= $q->field(0, 'epobject_id');
74
-                $this->body			= $q->field(0, 'body');
75
-                $this->posted		= $q->field(0, 'posted');
76
-                $this->visible		= $q->field(0, 'visible');
77
-                $this->modflagged	= $q->field(0, 'modflagged');
74
+                $this->body = $q->field(0, 'body');
75
+                $this->posted = $q->field(0, 'posted');
76
+                $this->visible = $q->field(0, 'visible');
77
+                $this->modflagged = $q->field(0, 'modflagged');
78 78
 
79 79
                 // Sets the URL and username for this comment. Duh.
80 80
                 $this->_set_url();
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
     public function comments_enabled() { return $this->comments_enabled; }
105 105
 
106 106
 
107
-    public function display($format='html', $template='comments') {
107
+    public function display($format = 'html', $template = 'comments') {
108 108
 
109
-        $data['comments'][0] = array (
109
+        $data['comments'][0] = array(
110 110
             'comment_id'	=> $this->comment_id,
111 111
             'user_id'		=> $this->user_id,
112 112
             'epobject_id'	=> $this->epobject_id,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $flag = 'NULL';
143 143
 
144 144
         } else {
145
-            $PAGE->error_message ("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!");
145
+            $PAGE->error_message("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!");
146 146
         }
147 147
 
148 148
         $q = $this->db->query("UPDATE comments
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $this->modflagged = $date;
155 155
             return true;
156 156
         } else {
157
-            $message = array (
157
+            $message = array(
158 158
                 'title' => 'Sorry',
159 159
                 'text' => "We couldn't update the annotation's modflag."
160 160
             );
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             if ($q->success()) {
177 177
                 return true;
178 178
             } else {
179
-                $message = array (
179
+                $message = array(
180 180
                     'title' => 'Sorry',
181 181
                     'text' => "We were unable to delete the annotation."
182 182
                 );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             }
186 186
 
187 187
         } else {
188
-            $message = array (
188
+            $message = array(
189 189
                 'title' => 'Sorry',
190 190
                 'text' => "You are not authorised to delete annotations."
191 191
             );
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@  discard block
 block discarded – undo
48 48
         // Set in init.php
49 49
         if (ALLOWCOMMENTS == true) {
50 50
             $this->comments_enabled = true;
51
-        } else {
51
+        }
52
+        else {
52 53
             $this->comments_enabled = false;
53 54
         }
54 55
 
@@ -81,7 +82,8 @@  discard block
 block discarded – undo
81 82
                 $this->_set_username();
82 83
 
83 84
                 $this->exists = true;
84
-            } else {
85
+            }
86
+            else {
85 87
                 $this->exists = false;
86 88
             }
87 89
         }
@@ -137,11 +139,13 @@  discard block
 block discarded – undo
137 139
             $date = gmdate("Y-m-d H:i:s");
138 140
             $flag = "'$date'";
139 141
 
140
-        } elseif ($switch == 'off') {
142
+        }
143
+        elseif ($switch == 'off') {
141 144
             $date = NULL;
142 145
             $flag = 'NULL';
143 146
 
144
-        } else {
147
+        }
148
+        else {
145 149
             $PAGE->error_message ("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!");
146 150
         }
147 151
 
@@ -153,7 +157,8 @@  discard block
 block discarded – undo
153 157
         if ($q->success()) {
154 158
             $this->modflagged = $date;
155 159
             return true;
156
-        } else {
160
+        }
161
+        else {
157 162
             $message = array (
158 163
                 'title' => 'Sorry',
159 164
                 'text' => "We couldn't update the annotation's modflag."
@@ -175,7 +180,8 @@  discard block
 block discarded – undo
175 180
 
176 181
             if ($q->success()) {
177 182
                 return true;
178
-            } else {
183
+            }
184
+            else {
179 185
                 $message = array (
180 186
                     'title' => 'Sorry',
181 187
                     'text' => "We were unable to delete the annotation."
@@ -184,7 +190,8 @@  discard block
 block discarded – undo
184 190
                 return false;
185 191
             }
186 192
 
187
-        } else {
193
+        }
194
+        else {
188 195
             $message = array (
189 196
                 'title' => 'Sorry',
190 197
                 'text' => "You are not authorised to delete annotations."
Please login to merge, or discard this patch.
www/includes/dbtypes.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 );
125 125
 $hansardmajors[104] = $hansardmajors[4];
126 126
 
127
-$parties = array (
127
+$parties = array(
128 128
     'Bp'    => 'Bishop',
129 129
     'Con'   => 'Conservative',
130 130
     'CWM'   => 'Deputy Speaker',
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
 */
167 167
 
168 168
 // Constants for various house types
169
-define ('HOUSE_TYPE_ROYAL', 0);
170
-define ('HOUSE_TYPE_COMMONS', 1);
171
-define ('HOUSE_TYPE_LORDS', 2);
172
-define ('HOUSE_TYPE_NI', 3);
173
-define ('HOUSE_TYPE_SCOTLAND', 4);
174
-define ('HOUSE_TYPE_WALES', 5);
169
+define('HOUSE_TYPE_ROYAL', 0);
170
+define('HOUSE_TYPE_COMMONS', 1);
171
+define('HOUSE_TYPE_LORDS', 2);
172
+define('HOUSE_TYPE_NI', 3);
173
+define('HOUSE_TYPE_SCOTLAND', 4);
174
+define('HOUSE_TYPE_WALES', 5);
Please login to merge, or discard this patch.
www/docs/foiorder2009/share.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
         <p></p>
17 17
     <?php
18 18
 
19
-$PAGE->block_start(array ('title'=>'Share this with your friends'));
19
+$PAGE->block_start(array('title'=>'Share this with your friends'));
20 20
 
21 21
 #foi2009_sharethis_link();
22 22
 #foi2009_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/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.
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.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,16 +5,20 @@  discard block
 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));
12 14
     if ($constituency == "CONNECTION_TIMED_OUT") {
13 15
             $errors['pc'] = "Sorry, we couldn't check your postcode right now. Please use the 'All Mps' link above to browse MPs";
14
-    } elseif ($constituency == "") {
16
+    }
17
+    elseif ($constituency == "") {
15 18
             $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode";
16 19
             twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency");
17
-       } else {
20
+       }
21
+       else {
18 22
             $MEMBER = new MEMBER(array('constituency' => $constituency));
19 23
             if ($MEMBER->person_id()) {
20 24
                 // This will cookie the postcode.
@@ -25,7 +29,8 @@  discard block
 block discarded – undo
25 29
                 header('Location: /rss/mp/' . $MEMBER->person_id() . '.rdf');
26 30
             }
27 31
         }
28
-    } else {
32
+    }
33
+    else {
29 34
         $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a valid postcode";
30 35
         twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form.");
31 36
     }
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/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.