Passed
Pull Request — master (#1962)
by
unknown
04:44
created
classes/AlertView/Simple.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         $existing = $this->alert->fetch_by_token($confirmation);
122 122
         preg_match('/speaker:(\d+)/', $existing['criteria'], $matches);
123 123
         $old_mp_id = $matches[1];
124
-        $old_mp = new \MySociety\TheyWorkForYou\Member([ 'person_id' => $old_mp_id ]);
125
-        $new_mp = new \MySociety\TheyWorkForYou\Member([ 'constituency' => $old_mp->constituency, 'house' => 1 ]);
124
+        $old_mp = new \MySociety\TheyWorkForYou\Member(['person_id' => $old_mp_id]);
125
+        $new_mp = new \MySociety\TheyWorkForYou\Member(['constituency' => $old_mp->constituency, 'house' => 1]);
126 126
 
127 127
         $q = $this->db->query(
128 128
             "SELECT alert_id, criteria, registrationtoken FROM alerts
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
         preg_match('/speaker:(\d+)/', $existing['criteria'], $matches);
186 186
         $criteria = $matches[1];
187 187
 
188
-        $old_mp = new \MySociety\TheyWorkForYou\Member([ 'person_id' => $criteria ]);
189
-        $new_mp = new \MySociety\TheyWorkForYou\Member([ 'constituency' => $old_mp->constituency, 'house' => 1 ]);
188
+        $old_mp = new \MySociety\TheyWorkForYou\Member(['person_id' => $criteria]);
189
+        $new_mp = new \MySociety\TheyWorkForYou\Member(['constituency' => $old_mp->constituency, 'house' => 1]);
190 190
 
191 191
         if ($this->alert->fetch_by_mp($existing['email'], $new_mp->person_id)) {
192 192
             $data = [
Please login to merge, or discard this patch.
classes/Search.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
         $data['search_keyword'] = $this->searchkeyword;
158 158
 
159 159
         $is_adv = false;
160
-        foreach (['to', 'from', 'person', 'section', 'column', 'phrase', 'exclude' ] as $var) {
160
+        foreach (['to', 'from', 'person', 'section', 'column', 'phrase', 'exclude'] as $var) {
161 161
             $key = "search_$var";
162 162
             $data[$key] = get_http_var($var);
163 163
             if ($data[$key]) {
Please login to merge, or discard this patch.
classes/Utility/Postcode.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
         if ($last_postcode == $postcode) {
44 44
             $return_value = $mp_only ? $last_postcode_value['WMC'] : $last_postcode_value;
45
-            twfy_debug("TIME", "Postcode $postcode looked up last time, is " . (is_array($return_value) ? implode(', ', $return_value) : $return_value));
45
+            twfy_debug("TIME", "postcode $postcode looked up last time, is " . (is_array($return_value) ? implode(', ', $return_value) : $return_value));
46 46
             return $return_value;
47 47
         }
48 48
 
Please login to merge, or discard this patch.
classes/Utility/Hansard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         global $hansardmajors;
39 39
         $db = new \ParlDB();
40 40
 
41
-        $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", [ ':gid' => $gid ])->first();
41
+        $q = $db->query("SELECT major FROM hansard WHERE gid = :gid", [':gid' => $gid])->first();
42 42
         $url_gid = fix_gid_from_db($gid);
43 43
         $url = new \MySociety\TheyWorkForYou\Url($hansardmajors[$q['major']]['page']);
44 44
         $url->insert(['id' => $url_gid]);
Please login to merge, or discard this patch.
classes/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
         $data['optin_service'] = $optin_values['optin_service'];
64 64
         $data['optin_stream'] = $optin_values['optin_stream'];
65 65
         $data['optin_org'] = $optin_values['optin_org'];
66
-        $data['postcode']	= $user->postcode();
66
+        $data['postcode'] = $user->postcode();
67 67
         $data['website']	= $user->url();
68
-        $data['registrationtime']	= $user->registrationtime();
68
+        $data['registrationtime'] = $user->registrationtime();
69 69
         $data['status'] = $user->status();
70 70
         $data["deleted"] = $user->deleted();
71 71
         $data["confirmed"] = $user->confirmed();
Please login to merge, or discard this patch.
classes/Homepage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
             $instance = new $class();
145 145
             $more_url = new Url($recent[1]);
146 146
             if ($recent[0] == 'recent_pbc_debates') {
147
-                $content = [ 'data' => $instance->display($recent[0], ['num' => 5], 'none') ];
147
+                $content = ['data' => $instance->display($recent[0], ['num' => 5], 'none')];
148 148
             } else {
149 149
                 $content = $instance->display($recent[0], ['days' => 7, 'num' => 1], 'none');
150 150
                 if (isset($content['data']) && count($content['data'])) {
Please login to merge, or discard this patch.
classes/Member.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
         usort(
262 262
             $departures,
263
-            function ($a, $b) {
263
+            function($a, $b) {
264 264
                 if ($a['date'] == $b['date']) {
265 265
                     return 0;
266 266
                 } elseif ($a['date'] < $b['date']) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             }
513 513
         }
514 514
 
515
-        uasort($policy_diffs, function ($a, $b) {
515
+        uasort($policy_diffs, function($a, $b) {
516 516
             return $b['score_difference'] - $a['score_difference'];
517 517
         });
518 518
 
Please login to merge, or discard this patch.
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
     }
214 214
 
215 215
     /**
216
-    * Image
217
-    *
218
-    * Return a URL for the member's image.
219
-    *
220
-    * @return string The URL of the member's image.
221
-    */
216
+     * Image
217
+     *
218
+     * Return a URL for the member's image.
219
+     *
220
+     * @return string The URL of the member's image.
221
+     */
222 222
 
223 223
     public function image() {
224 224
 
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
     }
272 272
 
273 273
     /**
274
-    * Offices
275
-    *
276
-    * Return an array of Office objects held (or previously held) by the member.
277
-    *
278
-    * @param string $include_only  Restrict the list to include only "previous" or "current" offices.
279
-    * @param bool   $ignore_committees Ignore offices that appear to be committee memberships.
280
-    * @param bool   $committees_only Only return committee memberships.
281
-    *
282
-    * @return array An array of Office objects.
283
-    */
274
+     * Offices
275
+     *
276
+     * Return an array of Office objects held (or previously held) by the member.
277
+     *
278
+     * @param string $include_only  Restrict the list to include only "previous" or "current" offices.
279
+     * @param bool   $ignore_committees Ignore offices that appear to be committee memberships.
280
+     * @param bool   $committees_only Only return committee memberships.
281
+     *
282
+     * @return array An array of Office objects.
283
+     */
284 284
 
285 285
     public function offices($include_only = null, $ignore_committees = false, $committees_only = false) {
286 286
 
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
     }
339 339
 
340 340
     /**
341
-    * Get Other Parties String
342
-    *
343
-    * Return a readable list of party changes for this member.
344
-    *
345
-    * @return string|null A readable list of the party changes for this member.
346
-    */
341
+     * Get Other Parties String
342
+     *
343
+     * Return a readable list of party changes for this member.
344
+     *
345
+     * @return string|null A readable list of the party changes for this member.
346
+     */
347 347
 
348 348
     public function getOtherPartiesString() {
349 349
 
@@ -362,12 +362,12 @@  discard block
 block discarded – undo
362 362
     }
363 363
 
364 364
     /**
365
-    * Get Other Constituencies String
366
-    *
367
-    * Return a readable list of other constituencies for this member.
368
-    *
369
-    * @return string|null A readable list of the other constituencies for this member.
370
-    */
365
+     * Get Other Constituencies String
366
+     *
367
+     * Return a readable list of other constituencies for this member.
368
+     *
369
+     * @return string|null A readable list of the other constituencies for this member.
370
+     */
371 371
 
372 372
     public function getOtherConstituenciesString() {
373 373
 
@@ -380,14 +380,14 @@  discard block
 block discarded – undo
380 380
     }
381 381
 
382 382
     /**
383
-    * Get Entered/Left Strings
384
-    *
385
-    * Return an array of readable strings covering when people entered or left
386
-    * various houses. Returns an array since it's possible for a member to have
387
-    * done several of these things.
388
-    *
389
-    * @return array An array of strings of when this member entered or left houses.
390
-    */
383
+     * Get Entered/Left Strings
384
+     *
385
+     * Return an array of readable strings covering when people entered or left
386
+     * various houses. Returns an array since it's possible for a member to have
387
+     * done several of these things.
388
+     *
389
+     * @return array An array of strings of when this member entered or left houses.
390
+     */
391 391
     public function getEnterLeaveStrings() {
392 392
         $output = [];
393 393
 
Please login to merge, or discard this patch.
tests/Bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     define('OPTION_MAPIT_URL', 'https://mapit.mysociety.org/');
28 28
 
29 29
     // If there isn't a config file (most likely this is running an automated test) copy one in.
30
-    if (! file_exists(dirname(__FILE__) . '/../conf/general')) {
30
+    if (!file_exists(dirname(__FILE__) . '/../conf/general')) {
31 31
         copy(dirname(__FILE__) . '/../conf/general-example', dirname(__FILE__) . '/../conf/general');
32 32
     }
33 33
 
Please login to merge, or discard this patch.
www/includes/easyparliament/init.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 // These variables are so we can keep date/time formats consistent across the site
18 18
 // and change them easily.
19 19
 // Formats here: http://www.php.net/manual/en/function.date.php
20
-define("LONGERDATEFORMAT", "%A, %e %B %Y");// Monday, 31 December 2003
21
-define("LONGDATEFORMAT", "%e %B %Y"); 	// 31 December 2003
22
-define("SHORTDATEFORMAT", "%e %b %Y");	// 31 Dec 2003
23
-define("TIMEFORMAT", "%l:%M %p");	// 11:59 pm
20
+define("LONGERDATEFORMAT", "%A, %e %B %Y"); // Monday, 31 December 2003
21
+define("LONGDATEFORMAT", "%e %B %Y"); // 31 December 2003
22
+define("SHORTDATEFORMAT", "%e %b %Y"); // 31 Dec 2003
23
+define("TIMEFORMAT", "%l:%M %p"); // 11:59 pm
24 24
 
25 25
 define("SHORTDATEFORMAT_SQL", "%e %b %Y"); // 31 Dec 2003
26 26
 define("TIMEFORMAT_SQL", "%l:%i %p"); // 11:59 PM
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 textdomain('TheyWorkForYou');
53 53
 
54 54
 // Set the default timezone
55
-if(function_exists('date_default_timezone_set')) {
55
+if (function_exists('date_default_timezone_set')) {
56 56
     date_default_timezone_set(TIMEZONE);
57 57
 }
58 58
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 include_once(INCLUDESPATH . "easyparliament/user.php");
106 106
 
107 107
 // Test to see if this is a new-style template using the renderer class.
108
-if (! isset($new_style_template) or $new_style_template !== true) {
108
+if (!isset($new_style_template) or $new_style_template !== true) {
109 109
 
110 110
     // This is an old-style page. Use the old page classes.
111 111
     include_once(INCLUDESPATH . "easyparliament/page.php");
Please login to merge, or discard this patch.