Failed Conditions
Pull Request — master (#1328)
by Nick
33:04 queued 18:05
created
www/includes/easyparliament/templates/html/people/index.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                           Based on postcode <strong><?= $mp_data['postcode'] ?></strong>
27 27
                           <a href="<?= $mp_data['change_url'] ?>">(Change postcode)</a>
28 28
                       </p>
29
-                    <?php if ( isset( $mp_data ) && $type != 'mlas' ) { ?>
29
+                    <?php if (isset($mp_data) && $type != 'mlas') { ?>
30 30
                       <h3>Your <?= $mp_data['former'] ? $mp_data['former'] . ' ' : '' ?><?= $rep_name ?> is</h3>
31 31
                     </div>
32 32
                     <a href="<?= $mp_data['mp_url'] ?>" class="people-list__person">
@@ -34,23 +34,23 @@  discard block
 block discarded – undo
34 34
                         <h2 class="people-list__person__name"><?= $mp_data['name'] ?></h2>
35 35
                         <p class="people-list__person__memberships">
36 36
                         <span class="people-list__person__constituency"><?= $mp_data['constituency'] ?></span>
37
-                        <span class="people-list__person__party <?= strtolower( $mp_data['party'] ) ?>"><?= $mp_data['party'] ?></span>
37
+                        <span class="people-list__person__party <?= strtolower($mp_data['party']) ?>"><?= $mp_data['party'] ?></span>
38 38
                         </p>
39 39
                     </a>
40 40
                     <?php }
41
-                    if ( isset($reps) ) {
42
-                        if ( isset($mp_data) && $type != 'mlas' ) { ?>
41
+                    if (isset($reps)) {
42
+                        if (isset($mp_data) && $type != 'mlas') { ?>
43 43
                     <div class="people-list__your-mp__replist-header">
44 44
                         <?php } ?>
45 45
                       <h3>Your <?=$former ?> <?= $rep_plural == 'MSPs' ? 'regional ' : '' ?><?= $rep_plural ?> are</h3>
46 46
                     </div>
47
-                        <?php foreach ( $reps as $rep ) { ?>
47
+                        <?php foreach ($reps as $rep) { ?>
48 48
                     <a href="<?= $rep['mp_url'] ?>" class="people-list__person">
49 49
                     <img class="people-list__person__image" src="<?= $rep['image'] ?>">
50 50
                         <h2 class="people-list__person__name"><?= $rep['name'] ?></h2>
51 51
                         <p class="people-list__person__memberships">
52 52
                         <span class="people-list__person__constituency"><?= $rep['constituency'] ?></span>
53
-                        <span class="people-list__person__party <?= strtolower( $rep['party'] ) ?>"><?= $rep['party'] ?></span>
53
+                        <span class="people-list__person__party <?= strtolower($rep['party']) ?>"><?= $rep['party'] ?></span>
54 54
                         </p>
55 55
                     </a>
56 56
                         <?php } ?>
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
             <div class="search-page__section search-page__section--search">
66 66
                 <div class="search-page__section__primary">
67 67
                     <p class="search-page-main-inputs">
68
-                    <?php if ( $type == 'peers' ) { ?>
68
+                    <?php if ($type == 'peers') { ?>
69 69
                         <label for="find-mp-by-name-or-postcode">Find <?= $rep_plural ?> by name:</label>
70
-                    <?php } elseif ( $type == 'mlas' || $type == 'msps' ) { ?>
70
+                    <?php } elseif ($type == 'mlas' || $type == 'msps') { ?>
71 71
                         <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by postcode:</label>
72 72
                     <?php } else { ?>
73 73
                         <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by name or postcode:</label>
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
             <div class="search-page__section__primary">
109 109
             <h2>All <?= $rep_plural ?></h2>
110 110
 
111
-                <?php if ( $type != 'peers' ) { ?>
111
+                <?php if ($type != 'peers') { ?>
112 112
                 <ul class="search-result-display-options">
113
-                    <?php if ( $order == 'given_name' ) { ?>
113
+                    <?php if ($order == 'given_name') { ?>
114 114
                     <li><strong>Sorted by</strong> First name</li>
115 115
                     <li>Sort by <a href="<?= $urls['by_last'] ?>">Last name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li>
116
-                    <?php } else if ( $order == 'party' ) { ?>
116
+                    <?php } else if ($order == 'party') { ?>
117 117
                     <li><strong>Sorted by</strong> Party</li>
118 118
                     <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_last'] ?>">Last name</a></li>
119 119
                     <?php } else { ?>
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 </ul>
124 124
                 <?php } else { ?>
125 125
                 <ul class="search-result-display-options">
126
-                    <?php if ( $order == 'party' ) { ?>
126
+                    <?php if ($order == 'party') { ?>
127 127
                     <li><strong>Sorted by</strong> Party</li>
128 128
                     <li>Sort by <a href="<?= $urls['by_name'] ?>">Name</a></li>
129 129
                     <?php } else { ?>
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
                     }
174 174
                 }
175 175
                 $initial_link = '';
176
-                foreach ( $data as $person ) {
176
+                foreach ($data as $person) {
177 177
                     if ($order != 'party') {
178
-                        $initial = substr( strtoupper($person[$a_to_z_key]), 0, 1);
179
-                        if ( $initial != $current_initial ) {
178
+                        $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1);
179
+                        if ($initial != $current_initial) {
180 180
                             $current_initial = $initial;
181 181
                             $initial_link = "name=\"$initial\" ";
182 182
                         } else {
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 <img class="people-list__person__image" src="<?= $person['image'] ?>">
189 189
                         <h2 class="people-list__person__name"><?= ucfirst($person['name']) ?></h2>
190 190
                         <p class="people-list__person__memberships">
191
-                        <?php if ( $person['constituency'] ) { ?>
191
+                        <?php if ($person['constituency']) { ?>
192 192
                         <span class="people-list__person__constituency"><?= $person['constituency'] ?></span>
193 193
                         <?php } ?>
194 194
                         <span class="people-list__person__party <?= strtolower($person['party']) ?>"><?= $person['party'] ?></span>
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 <a href="<?= $urls['by_csv'] ?>">Download this list as a CSV</a>
207 207
                     suitable for Excel
208 208
                 </p>
209
-                <?php if ( $type == 'mps' ) { ?>
209
+                <?php if ($type == 'mps') { ?>
210 210
                 <form method="get" action="<?= $urls['plain'] ?>" class="sidebar-item-with-icon sidebar-item-with-icon--date">
211 211
                     <p>
212 212
                         Or view a past list
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                   })
251 251
                 });
252 252
                 </script>
253
-                <?php } else if ( $type == 'msps' ) { ?>
253
+                <?php } else if ($type == 'msps') { ?>
254 254
                     <p class="past-list-dates" id="past-list-dates">
255 255
                         <a href="<?= $urls['plain'] ?>?date=2011-05-05">MSPs at 2011 election</a>
256 256
                         <a href="<?= $urls['plain'] ?>?date=2007-05-03">MSPs at 2007 election</a>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                     </p>
265 265
                 <?php } ?>
266 266
 
267
-                <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?>
267
+                <?php include(dirname(__FILE__) . '/../sidebar/looking_for.php') ?>
268 268
             </div>
269 269
         </div>
270 270
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_search_min.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@
 block discarded – undo
44 44
         ?></dt>
45 45
         <dd>
46 46
         <div class="appearance-date">
47
-            <div class="day"><?php echo format_date($row['hdate'], 'j' ) ?></div><!--
47
+            <div class="day"><?php echo format_date($row['hdate'], 'j') ?></div><!--
48 48
             <?php if ($year < $cur_year) { ?>
49
-            --><div class="month"><?php echo format_date($row['hdate'], 'M y' ) ?></div>
49
+            --><div class="month"><?php echo format_date($row['hdate'], 'M y') ?></div>
50 50
             <?php } else { ?>
51
-            --><div class="month"><?php echo format_date($row['hdate'], 'M' ) ?></div>
51
+            --><div class="month"><?php echo format_date($row['hdate'], 'M') ?></div>
52 52
             <?php } ?>
53 53
         </div>
54 54
 
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
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
                 <div class="row">
15 15
                 <span class="label">Website</span>
16
-                <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span>
16
+                <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span>
17 17
                 </div>
18 18
 
19 19
                 <div class="row">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         }(document, 'script', 'facebook-jssdk'));
159 159
     </script>
160 160
 
161
-  <?php if ( $banner_text ) { ?>
161
+  <?php if ($banner_text) { ?>
162 162
     <div class="banner">
163 163
         <div class="full-page__row">
164 164
             <div class="banner__content">
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                             <img src="/style/img/[email protected]" width="24" height="24" alt=""><span>Your Profile</span>
228 228
                         </a>
229 229
                         <ul id="nav-user">
230
-                          <?php foreach ($user_nav_links as $nav_link){ ?>
230
+                          <?php foreach ($user_nav_links as $nav_link) { ?>
231 231
                             <li><a href="<?= $nav_link['href']; ?>" title="<?= $nav_link['title']; ?>" class="<?= $nav_link['classes']; ?>"><?= $nav_link['text'] ?></a></li>
232 232
                             <?php } ?>
233 233
                         </ul>
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     <div class="full-page legacy-page static-page">
249 249
         <div class="full-page__row">
250 250
             <div class="panel">
251
-            <?php foreach ( $page_errors as $error ) { ?>
251
+            <?php foreach ($page_errors as $error) { ?>
252 252
                 <p><?= $error['text'] ?></p>
253 253
             <?php } ?>
254 254
             </div>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/index.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             <div class="panel panel--flushtop clearfix">
46 46
                 <div class="row nested-row">
47 47
                     <div class="homepage-in-the-news homepage-content-section">
48
-                        <?php if ( count($featured) > 0 ) {
48
+                        <?php if (count($featured) > 0) {
49 49
                             include 'homepage/featured.php';
50 50
                         } else { ?>
51 51
                             No debates found.
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
                     <div class="homepage-recently homepage-content-section">
109 109
                         <h2>Recently in Parliament</h2>
110 110
                         <ul class="recently__list"><?php
111
-                            foreach ( $debates['recent'] as $recent ) {
111
+                            foreach ($debates['recent'] as $recent) {
112 112
                                 include 'homepage/recent-debates.php';
113 113
                             }
114 114
                         ?></ul>
115 115
                     </div>
116 116
                     <div class="homepage-upcoming homepage-content-section">
117 117
                         <h2>Upcoming</h2>
118
-                        <?php if ( count($calendar) ) { ?>
118
+                        <?php if (count($calendar)) { ?>
119 119
                         <div class="upcoming__controls">
120 120
                             <!--
121 121
                                 These controls should make the upcoming section slide to the next day.
@@ -134,24 +134,24 @@  discard block
 block discarded – undo
134 134
                             </div>
135 135
                         </div>
136 136
                         <?php $first = true; $count = 0;
137
-                            foreach ( $calendar as $date => $places ) {
137
+                            foreach ($calendar as $date => $places) {
138 138
                                 $count++; ?>
139 139
                                 <div class="cal-wrapper <?= $first ? 'visible' : 'hidden' ?>" id="day-<?= $count ?>" data-count="<?= $count ?>" data-date="<?= format_date($date, SHORTDATEFORMAT); ?>">
140 140
                                 <?php foreach ($places as $place => $events) { ?>
141 141
                                     <?php $first = false; ?>
142 142
                                     <h3><?= $place ?></h3>
143 143
                                     <ul class="upcoming__list">
144
-                                        <?php for ( $i = 0; $i < 3; $i++ ) {
145
-                                            if ( isset( $events[$i] ) ) { ?>
144
+                                        <?php for ($i = 0; $i < 3; $i++) {
145
+                                            if (isset($events[$i])) { ?>
146 146
                                         <li>
147 147
                                             <h4 class="upcoming__title"><a href="<?= $events[$i]['link_external'] ?>"><?= $events[$i]['title'] ?></a></h4>
148 148
                                             <p class="meta"><?php
149 149
                                                 $meta_items = array();
150 150
                                                 $meta_items[] = $events[$i]['debate_type'];
151
-                                                if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ){
151
+                                                if (isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00') {
152 152
                                                     $times = format_time($events[$i]['time_start'], 'g:i a');
153 153
 
154
-                                                    if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ){
154
+                                                    if (isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00') {
155 155
                                                         $times = $times . ' - ' . format_time($events[$i]['time_end'], 'g:i a');
156 156
                                                     }
157 157
                                                     $meta_items[] = $times;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                                         <?php } ?>
164 164
                                         <?php } ?>
165 165
                                     </ul>
166
-                                    <?php if ( count($events) - 3 > 0 ) { ?>
166
+                                    <?php if (count($events) - 3 > 0) { ?>
167 167
                                     <a href="/calendar/?d=<?= format_date($date, 'Y-m-d') ?>" class="upcoming__more">And <?= count($events) - 3 ?> more</a><!-- (just links to relevant upcoming page) -->
168 168
                                     <?php } ?>
169 169
                             <?php } ?>
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                         <?php } ?>
172 172
                         <?php } else {
173 173
                             list($recess, $from, $to) = recess_prettify(date('j'), date('n'), date('Y'), 1);
174
-                            if ( $recess ) { ?>
174
+                            if ($recess) { ?>
175 175
                                 <p>
176 176
                                 Parliament is on holiday until <?= format_date($to, LONGERDATEFORMAT) ?>.
177 177
                                 Follow us on <a href="https://twitter.com/theyworkforyou">Twitter</a> and you'll
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,10 +148,10 @@
 block discarded – undo
148 148
                                             <p class="meta"><?php
149 149
                                                 $meta_items = array();
150 150
                                                 $meta_items[] = $events[$i]['debate_type'];
151
-                                                if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ){
151
+                                                if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ) {
152 152
                                                     $times = format_time($events[$i]['time_start'], 'g:i a');
153 153
 
154
-                                                    if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ){
154
+                                                    if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ) {
155 155
                                                         $times = $times . ' - ' . format_time($events[$i]['time_end'], 'g:i a');
156 156
                                                     }
157 157
                                                     $meta_items[] = $times;
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_glossary_search.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     ?>
43 43
                 <dl id="searchresults">
44 44
 <?php
45
-    for ($i=0; $i<count($data['rows']); $i++) {
45
+    for ($i = 0; $i < count($data['rows']); $i++) {
46 46
 
47 47
         $row = $data['rows'][$i];
48 48
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/homepage/recent-debates.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1
-                            <?php if ( isset( $recent['child'] ) ) { ?>
1
+                            <?php if (isset($recent['child'])) { ?>
2 2
                             <li class="parliamentary-excerpt">
3 3
                             <h3 class="excerpt__title"><a href="<?= $recent['list_url'] ?>"><?= $recent['parent']['body'] ? $recent['parent']['body'] . ' : ' : '' ?><?= $recent['body'] ?></a></h3>
4 4
                                 <p class="meta"><?=format_date($recent['hdate'], LONGERDATEFORMAT); ?></p>
5 5
                                 <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p>
6 6
                                 <p class="excerpt__statement">
7
-                                <?php if ( isset($recent['child']['speaker']) && count($recent['child']['speaker']) ) { ?>
7
+                                <?php if (isset($recent['child']['speaker']) && count($recent['child']['speaker'])) { ?>
8 8
                                 <a href="<?= $recent['child']['speaker']['url'] ?>"><?= $recent['child']['speaker']['name'] ?></a>
9 9
                                 <?php } ?>
10 10
                                 <?= trim_characters($recent['child']['body'], 0, 200) ?>
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
                             <?php } else { ?>
14 14
                             <li class="parliamentary-excerpt">
15 15
                             <h3 class="excerpt__title"><?= $recent['desc'] ?></h3>
16
-                                <?php foreach ( $recent['data'] as $date => $details ) { ?>
16
+                                <?php foreach ($recent['data'] as $date => $details) { ?>
17 17
                                 <p class="meta"><?= $date ?></p>
18 18
                                 <p class="meta excerpt__category"><a href="<?= $recent['more_url'] ?>"><?= $recent['desc'] ?></a></p>
19
-                                <?php foreach ( $details as $bill ) { ?>
19
+                                <?php foreach ($details as $bill) { ?>
20 20
                                 <p class="excerpt__statement">
21 21
                                     <a href="<?= $bill['url'] ?>"><?= $bill['bill'] ?>, <?= $bill['sitting'] ?></a>
22 22
                                 </p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/comments.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         if (!$comment['visible']) {
85 85
             $reporthtml = '';
86 86
         } elseif (($this_page != 'commentreport' &&
87
-            $this_page != 'addcomment'  &&
87
+            $this_page != 'addcomment' &&
88 88
             $this_page != 'admin_commentreport')
89 89
             && $THEUSER->is_able_to('reportcomment')
90 90
             && $THEUSER->user_id() != $comment['user_id']
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $date = format_date($date, SHORTDATEFORMAT);
120 120
         $time = format_time($time, TIMEFORMAT);
121 121
         ?>
122
-                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br>
122
+                    <p class="credit"><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) . ' ' . _htmlentities($comment['lastname']); ?></strong></a><br>
123 123
                     <small>Posted on <?php echo $date;
124 124
 
125 125
         if (isset($comment['url'])) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         } else {
129 129
             // There won't be a URL when we're just previewing a comment.
130
-            print ' '.$time;
130
+            print ' ' . $time;
131 131
         }
132 132
         ?> <?php echo $reporthtml; ?></small></p>
133 133
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $body = prepare_comment_for_display($comment['body']); // In utility.php
140 140
             echo "<p class=\"comment\">$body</p>\n";
141 141
         } else {
142
-            print '<p class="comment"><em>This annotation has been removed</em></p>'."\n";
142
+            print '<p class="comment"><em>This annotation has been removed</em></p>' . "\n";
143 143
         }
144 144
 
145 145
         ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_section.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
         </div>
7 7
 
8 8
         <?php
9
-            if ( isset($content['data']['data']) ) {
9
+            if (isset($content['data']['data'])) {
10 10
                 $data = $content['data']['data'];
11 11
                 include '_business_list.php'; ?>
12 12
                 <div class="business-section__secondary">
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
                 <?php
18 18
                 $calendar = $content['calendar']['years'];
19 19
                 include '_calendar_section.php';
20
-                if ( !isset($no_survey) ) {
21
-                    include( dirname(__FILE__) . '/../sidebar/looking_for.php' );
20
+                if (!isset($no_survey)) {
21
+                    include(dirname(__FILE__) . '/../sidebar/looking_for.php');
22 22
                 }
23 23
                 ?>
24
-                <?php if ( isset($content['rssurl']) ) { ?>
24
+                <?php if (isset($content['rssurl'])) { ?>
25 25
                 <p class="rss-feed">
26 26
                     <a href="<?= WEBPATH . $content['rssurl'] ?>">RSS feed of <?= $title ?></a>
27 27
                 </p>
Please login to merge, or discard this patch.