Completed
Push — master ( a4bf3a...585786 )
by Sam
08:59 queued 03:28
created
www/includes/easyparliament/templates/html/search/by-person.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,8 @@
 block discarded – undo
111 111
                                 <?php if ( $house !=  HOUSE_TYPE_LORDS) { ?>
112 112
                                   <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?>
113 113
                                 <?php } ?>
114
-                              <?php } else { // no $pid ?>
114
+                              <?php } else {
115
+// no $pid ?>
115 116
                                 <?= $speaker['name'] ?>
116 117
                               <?php } ?>
117 118
                             </td>
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@  discard block
 block discarded – undo
9 9
             <div class="search-page__section__primary">
10 10
                 <h2>Who says <em class="current-search-term"><?= _htmlentities($searchstring) ?></em> the most?</h2>
11 11
 
12
-              <?php if ( isset($error) ) { ?>
13
-                <?php if ( $error == 'No results' && isset( $house ) && $house != HOUSE_TYPE_ROYAL ) { ?>
12
+              <?php if (isset($error)) { ?>
13
+                <?php if ($error == 'No results' && isset($house) && $house != HOUSE_TYPE_ROYAL) { ?>
14 14
                   <ul class="search-result-display-options">
15 15
                       <li>
16
-                        <?php if ( $house ==  HOUSE_TYPE_COMMONS) { ?>
16
+                        <?php if ($house == HOUSE_TYPE_COMMONS) { ?>
17 17
                           No results for MPs only
18
-                        <?php } else if ( $house ==  HOUSE_TYPE_LORDS) { ?>
18
+                        <?php } else if ($house == HOUSE_TYPE_LORDS) { ?>
19 19
                           No results for Peers only
20
-                        <?php } else if ( $house == HOUSE_TYPE_SCOTLAND) { ?>
20
+                        <?php } else if ($house == HOUSE_TYPE_SCOTLAND) { ?>
21 21
                           No results for MSPs only
22
-                        <?php } else if ( $house ==  HOUSE_TYPE_NI) { ?>
22
+                        <?php } else if ($house == HOUSE_TYPE_NI) { ?>
23 23
                           No results for MLAs only
24 24
                         <?php } ?>
25 25
                           |
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
                 <?php } ?>
32 32
               <?php } ?>
33 33
 
34
-              <?php if ( $wtt ) { ?>
34
+              <?php if ($wtt) { ?>
35 35
                 <p><strong>Now, try reading what a couple of these Lords are saying,
36 36
                 to help you find someone appropriate. When you've found someone,
37 37
                 follow the "I want to write to (name of lord)" link on their results page
@@ -39,37 +39,37 @@  discard block
 block discarded – undo
39 39
                 </strong></p>
40 40
               <?php } ?>
41 41
 
42
-              <?php if ( isset($speakers) && count($speakers) ) { ?>
42
+              <?php if (isset($speakers) && count($speakers)) { ?>
43 43
 
44
-                  <?php if ( !$wtt ) { ?>
44
+                  <?php if (!$wtt) { ?>
45 45
                     <ul class="search-result-display-options">
46 46
                         <li>Results grouped by person</li>
47 47
                         <li>
48
-                          <?php if ( $house ==  HOUSE_TYPE_ROYAL) { ?>
48
+                          <?php if ($house == HOUSE_TYPE_ROYAL) { ?>
49 49
                             Show All
50 50
                           <?php } else { ?>
51 51
                             <a href="<?= $this_url->generate('html') ?>">Show All</a>
52 52
                           <?php } ?>
53 53
                             |
54
-                          <?php if ( $house ==  HOUSE_TYPE_COMMONS) { ?>
54
+                          <?php if ($house == HOUSE_TYPE_COMMONS) { ?>
55 55
                             MPs only
56 56
                           <?php } else { ?>
57 57
                             <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a>
58 58
                           <?php } ?>
59 59
                             |
60
-                          <?php if ( $house ==  HOUSE_TYPE_LORDS) { ?>
60
+                          <?php if ($house == HOUSE_TYPE_LORDS) { ?>
61 61
                             Peers only
62 62
                           <?php } else { ?>
63 63
                             <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a>
64 64
                           <?php } ?>
65 65
                             |
66
-                          <?php if ( $house ==  HOUSE_TYPE_SCOTLAND) { ?>
66
+                          <?php if ($house == HOUSE_TYPE_SCOTLAND) { ?>
67 67
                             MSPs only
68 68
                           <?php } else { ?>
69 69
                             <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a>
70 70
                           <?php } ?>
71 71
                             |
72
-                          <?php if ( $house ==  HOUSE_TYPE_NI) { ?>
72
+                          <?php if ($house == HOUSE_TYPE_NI) { ?>
73 73
                             MLAs only
74 74
                           <?php } else { ?>
75 75
                             <a href="<?= $this_url->generate('html', array('house'=>HOUSE_TYPE_NI)) ?>">MLAs only</a>
@@ -90,25 +90,25 @@  discard block
 block discarded – undo
90 90
                         </tr>
91 91
                     </thead>
92 92
                     <tbody>
93
-                      <?php foreach ( $speakers as $pid => $speaker ) { ?>
93
+                      <?php foreach ($speakers as $pid => $speaker) { ?>
94 94
 
95
-                        <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?>
95
+                        <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?>
96 96
 
97 97
                         <tr>
98 98
                             <td><?= $speaker['count'] ?></td>
99 99
                             <td>
100
-                              <?php if ( $pid ) { ?>
101
-                                <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?>
100
+                              <?php if ($pid) { ?>
101
+                                <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?>
102 102
                                   <a href="/search/?q=<?= _htmlentities($searchstring) ?>&amp;pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&amp;wtt=2' : '' ?>">
103 103
                                 <?php } ?>
104 104
                                 <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?>
105
-                                <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?>
105
+                                <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?>
106 106
                                   </a>
107 107
                                 <?php } ?>
108
-                                <?php if ( isset($speaker['party']) ) { ?>
108
+                                <?php if (isset($speaker['party'])) { ?>
109 109
                                   <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span>
110 110
                                 <?php } ?>
111
-                                <?php if ( $house !=  HOUSE_TYPE_LORDS) { ?>
111
+                                <?php if ($house != HOUSE_TYPE_LORDS) { ?>
112 112
                                   <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?>
113 113
                                 <?php } ?>
114 114
                               <?php } else { // no $pid ?>
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                               <?php } ?>
117 117
                             </td>
118 118
                             <td>
119
-                              <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?>
119
+                              <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?>
120 120
                                 <?= format_date($speaker['pmindate'], 'M Y') ?>
121 121
                               <?php } else { ?>
122 122
                                 <?= format_date($speaker['pmindate'], 'M Y') ?>&nbsp;&ndash;&nbsp;<?= format_date($speaker['pmaxdate'], 'M Y') ?>
Please login to merge, or discard this patch.
classes/EditQueue.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,9 +160,9 @@
 block discarded – undo
160 160
                                     VALUES
161 161
                                     (:id, :type, :enabled);',
162 162
                                     array(
163
-                                      ':id' => $q->insert_id(),
164
-                                      ':type' => EPTYPE_GLOSSARY,
165
-                                      ':enabled' => 1,
163
+                                        ':id' => $q->insert_id(),
164
+                                        ':type' => EPTYPE_GLOSSARY,
165
+                                        ':enabled' => 1,
166 166
                                     ));
167 167
                     // Again, no point carrying on if this fails,
168 168
                     // so remove the previous entry
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -194,8 +194,7 @@  discard block
 block discarded – undo
194 194
                             ));
195 195
             if (!$q->success()) {
196 196
                 break;
197
-            }
198
-            else {
197
+            } else {
199 198
                 // Now send them an email telling them they've been approved
200 199
 
201 200
 
@@ -236,8 +235,7 @@  discard block
 block discarded – undo
236 235
                             WHERE edit_id=" . $decline_id . ";");
237 236
             if (!$q->success()) {
238 237
                 break;
239
-            }
240
-            else {
238
+            } else {
241 239
                 // Scrub that one from the list of pending items
242 240
                 unset ($this->pending[$decline_id]);
243 241
             }
@@ -275,8 +273,7 @@  discard block
 block discarded – undo
275 273
             $this->update_pending_count();
276 274
 
277 275
             return true;
278
-        }
279
-        else {
276
+        } else {
280 277
             return false;
281 278
         }
282 279
     }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/header.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 } else if ($the_users_mp) {
56 56
                     $wtt_url = $wtt_url . "?a=WMC&amp;pc=" . _htmlentities(urlencode($user_postcode));
57 57
                 }
58
-              ?>
58
+                ?>
59 59
                 <a href="<?= $wtt_url ?>" class="button" onclick="trackLinkClick(this, 'Links', 'WriteToThem', 'Person'); return false;">Send a message</a>
60 60
               <?php } ?>
61 61
               <?php if ($has_email_alerts) { ?>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <div class="person-header <?= $current_member_anywhere ? '' : 'person-header--historical'; ?>">
2 2
     <div class="full-page__row">
3 3
         <div class="full-page__unit">
4
-          <?php if ( $image ) { ?>
4
+          <?php if ($image) { ?>
5 5
             <div class="person-header__image <?= $image['size'] == 'S' ? 'person-header__image--small' : '' ?>">
6
-              <?php if ( $image['size'] == 'S' ) { ?>
6
+              <?php if ($image['size'] == 'S') { ?>
7 7
                 <span style="background-image: url('<?= $image['url'] ?>');"></span>
8 8
               <?php } ?>
9 9
                 <img src="<?= $image['url'] ?>">
@@ -11,19 +11,19 @@  discard block
 block discarded – undo
11 11
           <?php } ?>
12 12
             <div class="person-header__about">
13 13
                 <h1 class="person-header__about__name"><?= ucfirst($full_name) ?></h1>
14
-              <?php if ( $known_for ) { ?>
14
+              <?php if ($known_for) { ?>
15 15
                 <p class="person-header__about__known-for">
16 16
                     <?= $known_for ?>
17 17
                 </p>
18 18
               <?php } ?>
19
-              <?php if ( $latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL ) { ?>
19
+              <?php if ($latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL) { ?>
20 20
                 <p class="person-header__about__position">
21 21
                     <span class="person-header__about__position__role">
22 22
                         <?= $latest_membership['current'] ? '' : 'Former' ?>
23 23
                         <?= $latest_membership['party'] == 'Bishop' ? '' : $latest_membership['party'] ?>
24 24
                         <?= $latest_membership['rep_name'] ?>
25 25
                     </span>
26
-                  <?php if ( $latest_membership['constituency'] ) { ?>
26
+                  <?php if ($latest_membership['constituency']) { ?>
27 27
                     for
28 28
                     <span class="person-header__about__position__constituency">
29 29
                         <?= $latest_membership['constituency'] ?>
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
               <?php } ?>
34 34
               <?php if (count($social_links) > 0) { ?>
35 35
                 <p class="person-header__about__media">
36
-                  <?php foreach ($social_links as $link){ ?>
36
+                  <?php foreach ($social_links as $link) { ?>
37 37
                       <a href="<?= $link['href'] ?>" onclick="trackLinkClick(this, 'Social-Link', '<?= $link['type'] ?>', '<?= $link['text'] ?>'); return false;"><?= $link['text'] ?></a>
38 38
                   <?php } ?>
39 39
                 </p>
Please login to merge, or discard this patch.
classes/Search/ParseArgs.php 1 patch
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,11 +28,17 @@  discard block
 block discarded – undo
28 28
 
29 29
         if (get_http_var('from') || get_http_var('to')) {
30 30
             $from = parse_date(get_http_var('from'));
31
-            if ($from) $from = $from['iso'];
32
-            else $from = '1919-01-01';
31
+            if ($from) {
32
+                $from = $from['iso'];
33
+            } else {
34
+                $from = '1919-01-01';
35
+            }
33 36
             $to = parse_date(get_http_var('to'));
34
-            if ($to) $to = $to['iso'];
35
-            else $to = date('Y-m-d');
37
+            if ($to) {
38
+                $to = $to['iso'];
39
+            } else {
40
+                $to = date('Y-m-d');
41
+            }
36 42
             $searchstring .= " $from..$to";
37 43
         }
38 44
 
@@ -105,8 +111,10 @@  discard block
 block discarded – undo
105 111
         }
106 112
 
107 113
         $advsection = get_http_var('section');
108
-        if (!$advsection)
109
-            $advsection = get_http_var('maj'); # Old URLs had this
114
+        if (!$advsection) {
115
+                    $advsection = get_http_var('maj');
116
+        }
117
+        # Old URLs had this
110 118
         if (is_array($advsection)) {
111 119
             $searchstring .= ' section:' . join(' section:', $advsection);
112 120
         } elseif ($advsection) {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/user/view_user.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
                 <div class="row">
10 10
                 <span class="label">Website</span>
11
-                <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span>
11
+                <span class="formw"><?= $website == '' ? 'none' : '<a rel="nofollow" href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span>
12 12
                 </div>
13 13
 
14 14
                 <div class="row">
Please login to merge, or discard this patch.
www/docs/admin/users.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     <input type="hidden" name="scrub" value="$email">
21 21
     <input type="submit" value="Delete user">
22 22
 </form>
23
-EOF;
23
+eof;
24 24
 }
25 25
 
26 26
 $user_data = array(
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/search/person.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,12 +2,12 @@
 block discarded – undo
2 2
     <img src="<?= $member->image()['url'] ?>" alt="">
3 3
     <h3 class="search-result__title"><a href="<?= $member->url() ?>"><?= $member->full_name() ?></a></h3>
4 4
     <?php $latest_membership = $member->getMostRecentMembership(); ?>
5
-    <?php if ( $latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL ) { ?>
5
+    <?php if ($latest_membership && $latest_membership['house'] != HOUSE_TYPE_ROYAL) { ?>
6 6
         <p class="search-result__description">
7 7
             <?= $latest_membership['current'] ? '' : 'Former' ?>
8 8
             <?= $latest_membership['party'] == 'Bishop' ? '' : $latest_membership['party'] ?>
9 9
             <?= $latest_membership['rep_name'] ?>
10
-            <?php if ( $latest_membership['constituency'] ) { ?>
10
+            <?php if ($latest_membership['constituency']) { ?>
11 11
                 for <?= $latest_membership['constituency'] ?>
12 12
             <?php } ?>
13 13
             (<?= format_date($latest_membership['start_date'], SHORTDATEFORMAT) ?> – <?= $latest_membership['current'] ? 'current' : format_date($latest_membership['end_date'], SHORTDATEFORMAT); ?>)
Please login to merge, or discard this patch.
www/docs/api/api_getConstituencies.php 2 patches
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,7 +108,9 @@  discard block
 block discarded – undo
108 108
     $geometry = _api_getGeometry();
109 109
     $out = array();
110 110
     foreach ($geometry['data'] as $name => $data) {
111
-        if (!isset($data['centre_lat']) || !isset($data['centre_lon'])) continue;
111
+        if (!isset($data['centre_lat']) || !isset($data['centre_lon'])) {
112
+            continue;
113
+        }
112 114
         $distance = R_e * acos(
113 115
             sin(deg2rad($lat)) * sin(deg2rad($data['centre_lat']))
114 116
             + cos(deg2rad($lat)) * cos(deg2rad($data['centre_lat']))
@@ -125,8 +127,12 @@  discard block
 block discarded – undo
125 127
         }
126 128
     }
127 129
     usort($out, function($a, $b) {
128
-        if ($a['distance'] > $b['distance']) return 1;
129
-        if ($a['distance'] < $b['distance']) return -1;
130
+        if ($a['distance'] > $b['distance']) {
131
+            return 1;
132
+        }
133
+        if ($a['distance'] < $b['distance']) {
134
+            return -1;
135
+        }
130 136
         return 0;
131 137
     });
132 138
     return $out;
@@ -145,7 +151,9 @@  discard block
 block discarded – undo
145 151
  * smallest angle between them.
146 152
  */
147 153
 function _api_angle_between($a1, $a2) {
148
-    if (abs($a1 - $a2) > M_PI) return 2*M_PI - abs($a1 - $a2);
154
+    if (abs($a1 - $a2) > M_PI) {
155
+        return 2*M_PI - abs($a1 - $a2);
156
+    }
149 157
     return abs($a1 - $a2);
150 158
 }
151 159
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         and c_main.main_name and constituency.name like :constituency_name and constituency.from_date <= date(now())
42 42
         and date(now()) <= constituency.to_date
43 43
         order by name', array(
44
-        ':constituency_name' => '%' . $s .'%'
44
+        ':constituency_name' => '%' . $s . '%'
45 45
         ));
46 46
     $output = array();
47 47
     $done = array();
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 function api_getConstituencies($date = 'now()') {
71 71
     $db = new ParlDB;
72 72
     $q = $db->query('select cons_id, name from constituency
73
-        where main_name and from_date <= date('.$date.') and date('.$date.') <= to_date
73
+        where main_name and from_date <= date('.$date . ') and date(' . $date . ') <= to_date
74 74
         order by name');
75 75
     $output = array();
76 76
     foreach ($q as $row) {
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  * smallest angle between them.
146 146
  */
147 147
 function _api_angle_between($a1, $a2) {
148
-    if (abs($a1 - $a2) > M_PI) return 2*M_PI - abs($a1 - $a2);
148
+    if (abs($a1 - $a2) > M_PI) return 2 * M_PI - abs($a1 - $a2);
149 149
     return abs($a1 - $a2);
150 150
 }
151 151
 
Please login to merge, or discard this patch.
classes/MiniSurvey.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 
24 24
         if ($hide_question) {
25 25
             $show_survey_qn = $current_question;
26
-            setcookie('survey', $current_question, time()+60*60*24*365, '/');
26
+            setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/');
27 27
         } elseif ($has_answered_question == $current_question && !$always_ask) {
28 28
             $show_survey_qn = $current_question;
29
-            setcookie('survey', $current_question, time()+60*60*24*365, '/');
29
+            setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/');
30 30
         } elseif (isset($_COOKIE['survey'])) {
31 31
             $show_survey_qn = $_COOKIE['survey'];
32 32
         }
@@ -36,18 +36,18 @@  discard block
 block discarded – undo
36 36
 
37 37
             $page_url = '';
38 38
             $hide_url = '';
39
-            if ( in_array( $this_page, array('mp', 'peer', 'msp', 'mla', 'royal') ) ) {
39
+            if (in_array($this_page, array('mp', 'peer', 'msp', 'mla', 'royal'))) {
40 40
                 global $MEMBER;
41
-                if ( $MEMBER ) {
41
+                if ($MEMBER) {
42 42
                     $page_url = $MEMBER->url(true) . "?answered_survey=$current_question";
43 43
                     $hide_url = $MEMBER->url() . "?hide_survey=$current_question";
44 44
                 }
45 45
             } else {
46 46
                 $URL = new Url($this_page);
47
-                $URL->insert(array('answered_survey' => $current_question ));
47
+                $URL->insert(array('answered_survey' => $current_question));
48 48
                 $page_url = 'https://' . DOMAIN . $URL->generate();
49 49
                 $URL = new Url($this_page);
50
-                $URL->insert(array('hide_survey' => $current_question ));
50
+                $URL->insert(array('hide_survey' => $current_question));
51 51
                 $hide_url = $URL->generate();
52 52
             }
53 53
 
Please login to merge, or discard this patch.