Failed Conditions
Pull Request — master (#1325)
by Nick
26:10 queued 21:10
created
classes/People/MPs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
             $details['family_name'],
31 31
             $details['party'],
32 32
             $details['constituency'],
33
-            'https://www.theyworkforyou.com/mp/' . $details['url']
33
+            'https://www.theyworkforyou.com/mp/'.$details['url']
34 34
         );
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
classes/Dissolution.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         }
27 27
 
28 28
         return array(
29
-            'query' => '(' . join(' OR ', $query) . ')',
29
+            'query' => '('.join(' OR ', $query).')',
30 30
             'params' => $params,
31 31
         );
32 32
     }
Please login to merge, or discard this patch.
classes/Topics.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -25,59 +25,59 @@
 block discarded – undo
25 25
     }
26 26
 
27 27
     public function getTopics() {
28
-      $q = $this->db->query("SELECT id, slug, title, description, search_string, front_page, image FROM topics");
28
+        $q = $this->db->query("SELECT id, slug, title, description, search_string, front_page, image FROM topics");
29 29
 
30
-      $topics = array();
31
-      $count = $q->rows();
30
+        $topics = array();
31
+        $count = $q->rows();
32 32
 
33
-      for ($i = 0; $i < $count; $i++ ) {
34
-          $topic = $q->row($i);
35
-          $topics[$topic['slug']] = new Topic($topic);
36
-      }
37
-      return $topics;
33
+        for ($i = 0; $i < $count; $i++ ) {
34
+            $topic = $q->row($i);
35
+            $topics[$topic['slug']] = new Topic($topic);
36
+        }
37
+        return $topics;
38 38
     }
39 39
 
40 40
     public function getTopic($topic_name) {
41
-      $q = $this->db->query(
42
-          "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE slug = :slug",
43
-          array(':slug' => $topic_name)
44
-      );
45
-      if ($q->rows) {
46
-          return new Topic($q->row(0));
47
-      }
48
-
49
-      return NULL;
41
+        $q = $this->db->query(
42
+            "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE slug = :slug",
43
+            array(':slug' => $topic_name)
44
+        );
45
+        if ($q->rows) {
46
+            return new Topic($q->row(0));
47
+        }
48
+
49
+        return NULL;
50 50
     }
51 51
 
52 52
     public function getFrontPageTopics() {
53
-      $q = $this->db->query(
54
-          "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE front_page = TRUE"
55
-      );
56
-
57
-      $topics = array();
58
-      $count = $q->rows();
59
-
60
-      for ($i = 0; $i < $count; $i++ ) {
61
-          $topic = $q->row($i);
62
-          $topics[$topic['slug']] = new Topic($topic);
63
-      }
64
-      return $topics;
53
+        $q = $this->db->query(
54
+            "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE front_page = TRUE"
55
+        );
56
+
57
+        $topics = array();
58
+        $count = $q->rows();
59
+
60
+        for ($i = 0; $i < $count; $i++ ) {
61
+            $topic = $q->row($i);
62
+            $topics[$topic['slug']] = new Topic($topic);
63
+        }
64
+        return $topics;
65 65
     }
66 66
 
67 67
     public function updateFrontPageTopics($topics) {
68 68
         // PDO doesn't cope with arrays so we have to do this by hand :|
69 69
         $quoted = array();
70 70
         if ($topics) {
71
-          foreach ($topics as $topic) {
72
-              $quoted[] = $this->db->quote($topic);
73
-          }
74
-          $topics_str = implode(',', $quoted);
71
+            foreach ($topics as $topic) {
72
+                $quoted[] = $this->db->quote($topic);
73
+            }
74
+            $topics_str = implode(',', $quoted);
75 75
 
76
-          $q = $this->db->query("UPDATE topics SET front_page = TRUE WHERE slug IN ($topics_str)");
76
+            $q = $this->db->query("UPDATE topics SET front_page = TRUE WHERE slug IN ($topics_str)");
77 77
 
78
-          $q = $this->db->query("UPDATE topics SET front_page = FALSE WHERE slug NOT IN ($topics_str)");
78
+            $q = $this->db->query("UPDATE topics SET front_page = FALSE WHERE slug NOT IN ($topics_str)");
79 79
         } else {
80
-          $q = $this->db->query("UPDATE topics SET front_page = FALSE");
80
+            $q = $this->db->query("UPDATE topics SET front_page = FALSE");
81 81
         }
82 82
 
83 83
         return true;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
       $topics = array();
31 31
       $count = $q->rows();
32 32
 
33
-      for ($i = 0; $i < $count; $i++ ) {
33
+      for ($i = 0; $i < $count; $i++) {
34 34
           $topic = $q->row($i);
35 35
           $topics[$topic['slug']] = new Topic($topic);
36 36
       }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
       $topics = array();
58 58
       $count = $q->rows();
59 59
 
60
-      for ($i = 0; $i < $count; $i++ ) {
60
+      for ($i = 0; $i < $count; $i++) {
61 61
           $topic = $q->row($i);
62 62
           $topics[$topic['slug']] = new Topic($topic);
63 63
       }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
           return new Topic($q->row(0));
47 47
       }
48 48
 
49
-      return NULL;
49
+      return null;
50 50
     }
51 51
 
52 52
     public function getFrontPageTopics() {
Please login to merge, or discard this patch.
classes/Policies.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     }
310 310
 
311 311
     public function getSetDescriptions() {
312
-      return $this->set_descs;
312
+        return $this->set_descs;
313 313
     }
314 314
 
315 315
     /**
@@ -397,18 +397,18 @@  discard block
 block discarded – undo
397 397
     }
398 398
 
399 399
     public function limitToArray($policies) {
400
-          $out = array();
401
-          // Reassemble the new policies list based on the set.
402
-          foreach ($policies as $policy) {
403
-              if (isset($this->policies[$policy])) {
404
-                  $out[$policy] = $this->policies[$policy];
405
-              }
406
-          }
407
-
408
-          $new_policies = new self();
409
-          $new_policies->policies = $out;
410
-
411
-          return $new_policies;
400
+            $out = array();
401
+            // Reassemble the new policies list based on the set.
402
+            foreach ($policies as $policy) {
403
+                if (isset($this->policies[$policy])) {
404
+                    $out[$policy] = $this->policies[$policy];
405
+                }
406
+            }
407
+
408
+            $new_policies = new self();
409
+            $new_policies->policies = $out;
410
+
411
+            return $new_policies;
412 412
     }
413 413
 
414 414
     public function getPolicyDetails($policyID) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     public function __construct($policy_id = NULL) {
297 297
         $this->db = new \ParlDB;
298 298
 
299
-        if ( $policy_id ) {
299
+        if ($policy_id) {
300 300
             $this->policy_id = $policy_id;
301 301
             $this->policies = array(
302 302
                 $policy_id => $this->policies[$policy_id]
@@ -380,8 +380,8 @@  discard block
 block discarded – undo
380 380
                     // want to complain here if we're looking for that policy and
381 381
                     // it does not exist. Otherwise, if the single policy isn't in
382 382
                     // the set we want to return an empty set
383
-                    if ( !isset($this->policy_id) || $set_policy == $this->policy_id ) {
384
-                        throw new \Exception ('Policy ' . $set_policy . ' in set "' . $set . '" does not exist.');
383
+                    if (!isset($this->policy_id) || $set_policy == $this->policy_id) {
384
+                        throw new \Exception('Policy '.$set_policy.' in set "'.$set.'" does not exist.');
385 385
                     }
386 386
                 }
387 387
             }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             return $new_policies;
393 393
 
394 394
         } else {
395
-            throw new \Exception ('Policy set "' . $set . '" does not exist.');
395
+            throw new \Exception('Policy set "'.$set.'" does not exist.');
396 396
         }
397 397
     }
398 398
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 
434 434
         $image = $q->field(0, 'image');
435 435
 
436
-        if ( $image && file_exists(BASEDIR . '/' . $image)) {
436
+        if ($image && file_exists(BASEDIR.'/'.$image)) {
437 437
             $props['image'] = $image;
438 438
             $props['image_license'] = $q->field(0, 'image_license');
439 439
             $props['image_attribution'] = $q->field(0, 'image_attrib');
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
 
294 294
     private $policy_id;
295 295
 
296
-    public function __construct($policy_id = NULL) {
296
+    public function __construct($policy_id = null) {
297 297
         $this->db = new \ParlDB;
298 298
 
299 299
         if ( $policy_id ) {
Please login to merge, or discard this patch.
classes/Search.php 2 patches
Switch Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -82,42 +82,42 @@
 block discarded – undo
82 82
     private function prettify_search_section($section) {
83 83
         $name = '';
84 84
         switch ($section) {
85
-        case 'wrans':
86
-            $name = 'Written Answers';
87
-            break;
88
-        case 'uk':
89
-            $name = 'All UK';
90
-            break;
91
-        case 'debates':
92
-            $name = 'House of Commons debates';
93
-            break;
94
-        case 'whall':
95
-            $name = 'Westminster Hall debates';
96
-            break;
97
-        case 'lords':
98
-            $name = 'House of Lords debates';
99
-            break;
100
-        case 'wms':
101
-            $name = 'Written ministerial statements';
102
-            break;
103
-        case 'standing':
104
-            $name = 'Bill Committees';
105
-            break;
106
-        case 'future':
107
-            $name = 'Future Business';
108
-            break;
109
-        case 'ni':
110
-            $name = 'Northern Ireland Assembly Debates';
111
-            break;
112
-        case 'scotland':
113
-            $name = 'All Scotland';
114
-            break;
115
-        case 'sp':
116
-            $name = 'Scottish Parliament Debates';
117
-            break;
118
-        case 'spwrans':
119
-            $name = 'Scottish Parliament Written answers';
120
-            break;
85
+            case 'wrans':
86
+                $name = 'Written Answers';
87
+                break;
88
+            case 'uk':
89
+                $name = 'All UK';
90
+                break;
91
+            case 'debates':
92
+                $name = 'House of Commons debates';
93
+                break;
94
+            case 'whall':
95
+                $name = 'Westminster Hall debates';
96
+                break;
97
+            case 'lords':
98
+                $name = 'House of Lords debates';
99
+                break;
100
+            case 'wms':
101
+                $name = 'Written ministerial statements';
102
+                break;
103
+            case 'standing':
104
+                $name = 'Bill Committees';
105
+                break;
106
+            case 'future':
107
+                $name = 'Future Business';
108
+                break;
109
+            case 'ni':
110
+                $name = 'Northern Ireland Assembly Debates';
111
+                break;
112
+            case 'scotland':
113
+                $name = 'All Scotland';
114
+                break;
115
+            case 'sp':
116
+                $name = 'Scottish Parliament Debates';
117
+                break;
118
+            case 'spwrans':
119
+                $name = 'Scottish Parliament Written answers';
120
+                break;
121 121
         }
122 122
 
123 123
         return $name;
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $this->searchstring = $argparser->construct_search_string();
20 20
         $this->searchkeyword = $argparser->searchkeyword;
21 21
 
22
-        if ( !$this->searchstring ) {
22
+        if (!$this->searchstring) {
23 23
             $data = $this->get_form_params($data);
24 24
             $data['searchstring'] = '';
25 25
             $data['template'] = 'search/results';
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 
29 29
         $this->searchstring = filter_user_input($this->searchstring, 'strict');
30 30
         $warnings = $this->validate_search_string();
31
-        if ( $warnings ) {
31
+        if ($warnings) {
32 32
             $data['warnings'] = $warnings;
33 33
             $data['template'] = 'search/results';
34 34
             $data['searchstring'] = $this->searchstring;
35 35
             $data = $this->get_form_params($data);
36 36
             return $data;
37 37
         } else {
38
-            if (get_http_var('o')=='p') {
38
+            if (get_http_var('o') == 'p') {
39 39
                 $search = new Search\ByUsage();
40 40
                 $data = $search->search($this->searchstring);
41 41
                 $data['template'] = 'search/by-person';
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $data['person_name'] = $MEMBER->full_name();
53 53
         }
54 54
 
55
-        if ( isset($data['info']['spelling_correction']) ) {
55
+        if (isset($data['info']['spelling_correction'])) {
56 56
             $data['info']['spelling_correction_display'] = $this->prettifySearchString($data['info']['spelling_correction']);
57 57
         }
58 58
 
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
         $data['search_keyword'] = $this->searchkeyword;
145 145
 
146 146
         $is_adv = false;
147
-        foreach ( array('to', 'from', 'person', 'section', 'column', 'phrase', 'exclude' ) as $var ) {
147
+        foreach (array('to', 'from', 'person', 'section', 'column', 'phrase', 'exclude') as $var) {
148 148
             $key = "search_$var";
149
-            $data[$key] = get_http_var( $var );
150
-            if ( $data[$key] ) {
149
+            $data[$key] = get_http_var($var);
150
+            if ($data[$key]) {
151 151
                 $is_adv = true;
152 152
             }
153 153
         }
154 154
 
155
-        if ( isset($data['search_section']) ) {
155
+        if (isset($data['search_section'])) {
156 156
             $data['search_section_pretty'] = $this->prettify_search_section($data['search_section']);
157 157
         }
158 158
 
@@ -162,16 +162,16 @@  discard block
 block discarded – undo
162 162
 
163 163
     private function set_wtt_options($data) {
164 164
         $data['wtt'] = '';
165
-        if ( $wtt = get_http_var('wtt') ) {
165
+        if ($wtt = get_http_var('wtt')) {
166 166
             $data['wtt'] = $wtt;
167
-            if ( $wtt == 2 && $pid = get_http_var('pid') ) {
167
+            if ($wtt == 2 && $pid = get_http_var('pid')) {
168 168
                 $data['pid'] = null;
169 169
                 try {
170 170
                     $lord = new Member(array('person_id' => $pid, 'house' => 2));
171
-                } catch ( MemberException $e ) {
171
+                } catch (MemberException $e) {
172 172
                     return $data;
173 173
                 }
174
-                if ( $lord->valid ) {
174
+                if ($lord->valid) {
175 175
                     $data['pid'] = $pid;
176 176
                     $data['wtt_lord_name'] = $lord->full_name();
177 177
                 }
@@ -190,17 +190,17 @@  discard block
 block discarded – undo
190 190
             $value = $this->searchstring;
191 191
             if (preg_match_all('#speaker:(\d+)#', $value, $m) == 1) {
192 192
                 $person_id = $m[1][0];
193
-                $value = str_replace('speaker:' . $person_id, '', $value);
193
+                $value = str_replace('speaker:'.$person_id, '', $value);
194 194
                 $url->insert(array('pid' => $person_id));
195 195
                 }
196 196
             $url->insert(array('q' => $value));
197 197
         }
198 198
 
199
-        if ( $params ) {
200
-            if ( get_http_var('house') ) {
199
+        if ($params) {
200
+            if (get_http_var('house')) {
201 201
                 $url->insert(array('house' => get_http_var('house')));
202 202
             }
203
-            if ( get_http_var('wtt') ) {
203
+            if (get_http_var('wtt')) {
204 204
                 $url->insert(array('wtt' => get_http_var('wtt')));
205 205
             }
206 206
         } else {
@@ -214,16 +214,16 @@  discard block
 block discarded – undo
214 214
         global $DATA, $this_page;
215 215
 
216 216
         $pagetitle = '';
217
-        if ( isset($data['search_type']) && $data['search_type'] == 'person' ) {
217
+        if (isset($data['search_type']) && $data['search_type'] == 'person') {
218 218
             if (isset($data['wtt']) && $data['wtt'] > 0) {
219
-                $pagetitle = 'League table of Lords who say ' . $data['pagetitle'];
219
+                $pagetitle = 'League table of Lords who say '.$data['pagetitle'];
220 220
             } else {
221
-                $pagetitle = 'Who says ' . $data['pagetitle'] . ' the most?';
221
+                $pagetitle = 'Who says '.$data['pagetitle'].' the most?';
222 222
             }
223 223
         } else {
224
-            $pagetitle = 'Search for ' . $data['searchdescription'];
224
+            $pagetitle = 'Search for '.$data['searchdescription'];
225 225
             if (isset($data['info']['page']) && $data['info']['page'] > 1) {
226
-                $pagetitle .= ", page " . $data['info']['page'];
226
+                $pagetitle .= ", page ".$data['info']['page'];
227 227
             }
228 228
         }
229 229
         $DATA->set_page_metadata($this_page, 'title', $pagetitle);
Please login to merge, or discard this patch.
classes/SPHomepage.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     }
39 39
 
40 40
     protected function getCalendarData() {
41
-        return NULL;
41
+        return null;
42 42
     }
43 43
 
44 44
 
Please login to merge, or discard this patch.
classes/AlertView.php 1 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
     protected $db;
12 12
     protected $alert;
13 13
 
14
-    public function __construct($THEUSER = NULL) {
14
+    public function __construct($THEUSER = null) {
15 15
         $this->user = $THEUSER;
16 16
         $this->db = new \ParlDB;
17 17
         $this->alert = new \ALERT;
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/static/linktous.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     </form>
25 25
 </div>
26 26
 <!-- TheyWorkForYou box, end -->
27
-END;
27
+end;
28 28
 print $link_to_us_form;
29 29
 ?>
30 30
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/recent.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <div class="full-page__row">
2 2
     <?php include '_business_section.php'; ?>
3
-    <?php $search_title = "Search $title"; include '_search.php'; ?>
3
+    <?php $search_title = "search $title"; include '_search.php'; ?>
4 4
 </div>
Please login to merge, or discard this patch.