Failed Conditions
Pull Request — master (#1327)
by Nick
69:15 queued 59:17
created
www/includes/easyparliament/templates/html/section/pbc_bill.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
             <ul class="business-list">
25 25
             <?php
26 26
                 $first = 0;
27
-                foreach ( $content['rows'] as $row ) {
28
-                    if ( $row['htype'] == 10 ) {
29
-                        if ( !$first ) {
27
+                foreach ($content['rows'] as $row) {
28
+                    if ($row['htype'] == 10) {
29
+                        if (!$first) {
30 30
                             print '</li>';
31 31
                             $first = 1;
32 32
                         } ?>
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
                                 </h3>
38 38
                             </a>
39 39
                             <p class="business-list__meta">
40
-                                <?php if ( isset($row['sitting']) ) { ?>
40
+                                <?php if (isset($row['sitting'])) { ?>
41 41
                                     <?= make_ranking($row['sitting']) ?> sitting &middot;
42 42
                                 <?php } ?>
43
-                                <?= format_date($row['hdate'], LONGERDATEFORMAT ) ?>
44
-                                <?php if ( $row['contentcount'] > 0 ) { ?>
43
+                                <?= format_date($row['hdate'], LONGERDATEFORMAT) ?>
44
+                                <?php if ($row['contentcount'] > 0) { ?>
45 45
                                 &middot; <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
46 46
                                 <?php } ?>
47 47
                             </p>
48 48
                             <p class="business-list__excerpt">
49
-                                <?= trim_characters($row['excerpt'], 0, 200 ) ?>
49
+                                <?= trim_characters($row['excerpt'], 0, 200) ?>
50 50
                             </p>
51 51
                     <?php } else { ?>
52 52
                     <ul>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                                     <?= $row['contentcount'] == 1 ? '1 speech' : $row['contentcount'] . ' speeches' ?>
62 62
                                 </p>
63 63
                             <?php } ?>
64
-                            <?php if ( isset($row['excerpt']) ) { ?>
64
+                            <?php if (isset($row['excerpt'])) { ?>
65 65
                                 <p class="business-list__excerpt">
66 66
                                     <?= trim_characters($row['excerpt'], 0, 200) ?>
67 67
                                 </p>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             </ul>
74 74
         </div>
75 75
 
76
-        <?php if ( isset($content['info']['committee']) ) {
76
+        <?php if (isset($content['info']['committee'])) {
77 77
             $committee = $content['info']['committee'];
78 78
         ?>
79 79
         <div class="business-section__secondary">
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
 
86 86
             <p><strong>Chairpersons</strong></p>
87 87
             <ul>
88
-            <?php foreach( $committee['chairmen'] as $chair ) { ?>
88
+            <?php foreach ($committee['chairmen'] as $chair) { ?>
89 89
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
90 90
             <?php } ?>
91 91
             </ul>
92 92
             <p><strong>Members</strong></p>
93 93
             <ul>
94
-            <?php foreach( $committee['members'] as $chair ) { ?>
94
+            <?php foreach ($committee['members'] as $chair) { ?>
95 95
                 <li><?= $chair['name'] ?> (<?= $chair['attending'] ?>)</li>
96 96
             <?php } ?>
97 97
             </ul>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
                             <p class="business-list__excerpt">
49 49
                                 <?= trim_characters($row['excerpt'], 0, 200 ) ?>
50 50
                             </p>
51
-                    <?php } else { ?>
51
+                    <?php }
52
+else { ?>
52 53
                     <ul>
53 54
                         <li>
54 55
                             <a href="<?= $row['listurl'] ?>" class="business-list__title">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_list_item.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <a href="<?= $item['list_url'] ?>" class="business-list__title">
2 2
     <h3>
3
-      <?php if ( isset( $item['parent'] ) ) { ?>
3
+      <?php if (isset($item['parent'])) { ?>
4 4
         <?= $item['parent']['body'] ?>
5 5
         <br><?= $item['body'] ?>
6 6
       <?php } else { ?>
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
     </h3>
10 10
     <span class="business-list__meta">
11 11
       <?= format_date($item['hdate'], LONGERDATEFORMAT) ?>
12
-      <?=  isset($item['contentcount']) ? '&middot; ' . $item['contentcount'] . ( $item['contentcount'] == 1 ? ' speech' : ' speeches' ) : '' ?>
12
+      <?=  isset($item['contentcount']) ? '&middot; ' . $item['contentcount'] . ($item['contentcount'] == 1 ? ' speech' : ' speeches') : '' ?>
13 13
     </span>
14 14
 </a>
15
-<?php if ( isset( $item['child'] ) ) { ?>
15
+<?php if (isset($item['child'])) { ?>
16 16
 <p class="business-list__excerpt">
17
-  <?php if ( isset($item['child']['speaker']) && count($item['child']['speaker']) > 0 ) { ?>
17
+  <?php if (isset($item['child']['speaker']) && count($item['child']['speaker']) > 0) { ?>
18 18
     <a href="<?= $item['child']['speaker']['url'] ?>"><?= $item['child']['speaker']['name'] ?></a>
19 19
   <?php } ?>
20
-  <?= strip_tags(trim_characters( $item['child']['body'], 0, 200 )) ?>
20
+  <?= strip_tags(trim_characters($item['child']['body'], 0, 200)) ?>
21 21
 </p>
22 22
 <?php } ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@
 block discarded – undo
3 3
       <?php if ( isset( $item['parent'] ) ) { ?>
4 4
         <?= $item['parent']['body'] ?>
5 5
         <br><?= $item['body'] ?>
6
-      <?php } else { ?>
6
+      <?php }
7
+else { ?>
7 8
         <?= $item['body'] ?>
8 9
       <?php } ?>
9 10
     </h3>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/hansard_search_video.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@
 block discarded – undo
33 33
 
34 34
         echo '&#8220;' . $row['extract'] . "&#8221;</dd>\n";
35 35
         echo '<dd><em><small>This speech is ';
36
-        if ($row['hpos']-$want['hpos']>0) {
37
-            echo ($row['hpos']-$want['hpos']) . ' later than';
36
+        if ($row['hpos'] - $want['hpos'] > 0) {
37
+            echo ($row['hpos'] - $want['hpos']) . ' later than';
38 38
         } else {
39
-            echo ($want['hpos']-$row['hpos']) . ' earlier than';
39
+            echo ($want['hpos'] - $row['hpos']) . ' earlier than';
40 40
         }
41 41
         echo ' the one you want &ndash; ';
42
-        if ($row['video_status']&8 || !($row['video_status']&1)) {
42
+        if ($row['video_status'] & 8 || !($row['video_status'] & 1)) {
43 43
             echo ' it doesn\'t have any video';
44
-        } elseif ($row['video_status']&4) {
44
+        } elseif ($row['video_status'] & 4) {
45 45
             echo ' it has already been matched';
46
-        } elseif ($row['video_status']&1) {
46
+        } elseif ($row['video_status'] & 1) {
47 47
             # Only for Commons currently
48 48
             echo ' if you prefer, <a target="_top" onclick="t = parent.document[\'video\'].currentTime(); this.href += t;" href="/video/?gid=debate/' . $row['gid'] . '&amp;file=' . $want['file'] . '&amp;start=">switch to matching this speech instead</a>';
49 49
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,21 +35,25 @@
 block discarded – undo
35 35
         echo '<dd><em><small>This speech is ';
36 36
         if ($row['hpos']-$want['hpos']>0) {
37 37
             echo ($row['hpos']-$want['hpos']) . ' later than';
38
-        } else {
38
+        }
39
+        else {
39 40
             echo ($want['hpos']-$row['hpos']) . ' earlier than';
40 41
         }
41 42
         echo ' the one you want &ndash; ';
42 43
         if ($row['video_status']&8 || !($row['video_status']&1)) {
43 44
             echo ' it doesn\'t have any video';
44
-        } elseif ($row['video_status']&4) {
45
+        }
46
+        elseif ($row['video_status']&4) {
45 47
             echo ' it has already been matched';
46
-        } elseif ($row['video_status']&1) {
48
+        }
49
+        elseif ($row['video_status']&1) {
47 50
             # Only for Commons currently
48 51
             echo ' if you prefer, <a target="_top" onclick="t = parent.document[\'video\'].currentTime(); this.href += t;" href="/video/?gid=debate/' . $row['gid'] . '&amp;file=' . $want['file'] . '&amp;start=">switch to matching this speech instead</a>';
49 52
         }
50 53
         echo '</small></em></dd>';
51 54
     }
52 55
     echo '</dl>';
53
-} else {
56
+}
57
+else {
54 58
     echo '<p>No data to display.</p>';
55 59
 }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/glossary.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $USERURL->insert(array('u'=>$comment['user_id']));
78 78
         ?>
79 79
         <div class="comment">
80
-            <p><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) .' '. _htmlentities($comment['lastname']); ?></strong></a><br>
80
+            <p><a href="<?php echo $USERURL->generate(); ?>" title="See information about this user"><strong><?php echo _htmlentities($comment['firstname']) . ' ' . _htmlentities($comment['lastname']); ?></strong></a><br>
81 81
 <?php
82 82
         // Make URLs into links and do <br>s.
83 83
         $body = prepare_comment_for_display($comment['body']); // In utility.php
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         }
106 106
 
107 107
         if (($this_page != 'commentreport' &&
108
-            $this_page != 'addcomment'  &&
108
+            $this_page != 'addcomment' &&
109 109
             $this_page != 'admin_commentreport')
110 110
             && $THEUSER->is_able_to('reportcomment')
111 111
             && !$comment['modflagged']
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,13 +39,16 @@  discard block
 block discarded – undo
39 39
     // If we're just previewing a comment, we passed in 'preview' => true.
40 40
     $subheading = 'Your annotation would look like this:';
41 41
 
42
-} elseif ($this_page == 'addcomment') {
42
+}
43
+elseif ($this_page == 'addcomment') {
43 44
     $subheading = 'Previous annotations';
44 45
 
45
-} elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46
+}
47
+elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46 48
     $subheading = "";
47 49
 
48
-} else {
50
+}
51
+else {
49 52
     $subheading = 'Annotations';
50 53
 }
51 54
 
@@ -69,7 +72,8 @@  discard block
 block discarded – undo
69 72
         if (isset($comment['comment_id'])) {
70 73
             ?> id="c<?php echo $comment['comment_id']; ?>"><a name="c<?php echo $comment['comment_id']; ?>"></a>
71 74
 <?php
72
-        } else {
75
+        }
76
+        else {
73 77
             echo ">\n";
74 78
         }
75 79
 
@@ -99,7 +103,8 @@  discard block
 block discarded – undo
99 103
             ?>
100 104
         <a href="<?php echo $comment['url']; ?>" title="Link to this annotation"><?php echo $time; ?></a>
101 105
 <?php
102
-        } else {
106
+        }
107
+        else {
103 108
             // There won't be a URL when we're just previewing a comment.
104 109
             echo "\t\t$time";
105 110
         }
@@ -124,7 +129,8 @@  discard block
 block discarded – undo
124 129
         <a href="<?php echo $URL->generate(); ?>" title="Notify moderators that this annotation needs editing or deleting">Report this annotation</a>
125 130
 <?php
126 131
 
127
-        } elseif ($comment['modflagged']) {
132
+        }
133
+        elseif ($comment['modflagged']) {
128 134
             ?><br>
129 135
         This annotation has been reported
130 136
 <?php
@@ -139,7 +145,8 @@  discard block
 block discarded – undo
139 145
 
140 146
     }
141 147
 
142
-} else {
148
+}
149
+else {
143 150
 
144 151
     ?>
145 152
     <p>No annotations</p>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/hansard_calendar.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,6 +13,7 @@
 block discarded – undo
13 13
         }
14 14
     }
15 15
     api_output($out);
16
-} else {
16
+}
17
+else {
17 18
     api_error('Please supply a year');
18 19
 }
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/comments.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         // COMMENT REPORTING LINK.
83 83
 
84 84
         if (($this_page != 'commentreport' &&
85
-            $this_page != 'addcomment'  &&
85
+            $this_page != 'addcomment' &&
86 86
             $this_page != 'admin_commentreport')
87 87
             && $THEUSER->is_able_to('reportcomment')
88 88
             && $THEUSER->user_id() != $comment['user_id']
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $date = format_date($date, SHORTDATEFORMAT);
118 118
         $time = format_time($time, TIMEFORMAT);
119 119
         ?>
120
-                    <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>
120
+                    <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>
121 121
                     <small>Posted on <?php echo $date;
122 122
 
123 123
         if (isset($comment['url'])) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         } else {
127 127
             // There won't be a URL when we're just previewing a comment.
128
-            print ' '.$time;
128
+            print ' ' . $time;
129 129
         }
130 130
         ?> <?php echo $reporthtml; ?></small></p>
131 131
 
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,13 +39,16 @@  discard block
 block discarded – undo
39 39
     // If we're just previewing a comment, we passed in 'preview' => true.
40 40
     $subheading = 'Your comment would look like this:';
41 41
 
42
-} elseif ($this_page == 'addcomment') {
42
+}
43
+elseif ($this_page == 'addcomment') {
43 44
     $subheading = 'Previous annotations';
44 45
 
45
-} elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46
+}
47
+elseif ($this_page == 'commentreport' || $this_page == 'admin_commentreport') {
46 48
     $subheading = "";
47 49
 
48
-} else {
50
+}
51
+else {
49 52
     $subheading = 'Annotations';
50 53
 }
51 54
 
@@ -70,7 +73,8 @@  discard block
 block discarded – undo
70 73
 
71 74
         if (isset($comment['comment_id'])) {
72 75
             $id = 'c' . $comment['comment_id'];
73
-        } else {
76
+        }
77
+        else {
74 78
             $id = '';
75 79
         }
76 80
 
@@ -100,9 +104,11 @@  discard block
 block discarded – undo
100 104
 
101 105
             $reporthtml = '(<a href="' . $URL->generate() . '" title="Notify moderators that this comment should be deleted">Report this comment</a>)';
102 106
 
103
-        } elseif ($comment['modflagged']) {
107
+        }
108
+        elseif ($comment['modflagged']) {
104 109
             $reporthtml = '(This comment has been reported to moderators)';
105
-        } else {
110
+        }
111
+        else {
106 112
             // When previewing a comment...
107 113
             $reporthtml = '';
108 114
         }
@@ -123,7 +129,8 @@  discard block
 block discarded – undo
123 129
         if (isset($comment['url'])) {
124 130
             print ' <a href="' . $comment['url'] . '" title="Link to this comment">' . $time . '</a>';
125 131
 
126
-        } else {
132
+        }
133
+        else {
127 134
             // There won't be a URL when we're just previewing a comment.
128 135
             print ' '.$time;
129 136
         }
@@ -144,7 +151,8 @@  discard block
 block discarded – undo
144 151
 <?php
145 152
     }
146 153
 
147
-} else {
154
+}
155
+else {
148 156
 
149 157
     ?>
150 158
                 <div class="comment">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/comments_user.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
         // Get the name of the member whose epobject was commented upon (if any).
41 41
         if (isset($comment['speaker']) && $comment['speaker']['name'] != '') {
42 42
             $member_name = $comment['speaker']['name'] . ': ';
43
-        } else {
43
+        }
44
+        else {
44 45
             $member_name = '';
45 46
         }
46 47
 
@@ -61,7 +62,8 @@  discard block
 block discarded – undo
61 62
     $PAGE->page_links($data);
62 63
     $PAGE->stripe_end();
63 64
 
64
-} else {
65
+}
66
+else {
65 67
 
66 68
     $PAGE->stripe_start();
67 69
     ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/editqueue.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 
85 85
         if ($q->success()) {
86 86
             // Set the object variables up.
87
-            $this->editqueue_id 	= $q->insert_id();
87
+            $this->editqueue_id = $q->insert_id();
88 88
             $this->title			= $data['title'];
89 89
             $this->body				= $data['body'];
90
-            $this->posted			= $data['posted'];
90
+            $this->posted = $data['posted'];
91 91
 
92 92
             return $this->editqueue_id;
93 93
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             // the new epobject id and approval details.
168 168
             $q = $this->db->query("UPDATE editqueue
169 169
                             SET
170
-                            epobject_id_l='" .  $this->current_epobject_id. "',
170
+                            epobject_id_l='" .  $this->current_epobject_id . "',
171 171
                             editor_id='" . addslashes($THEUSER->user_id()) . "',
172 172
                             approved='1',
173 173
                             decided='" . $timestamp . "'
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         $q = $this->db->query("SELECT eq.edit_id, eq.user_id, u.firstname, u.lastname, eq.glossary_id, eq.title, eq.body, eq.submitted FROM editqueue AS eq, users AS u WHERE eq.user_id = u.user_id AND eq.approved IS NULL ORDER BY eq.submitted DESC;");
250 250
         if ($q->success() && $q->rows()) {
251 251
             for ($i = 0; $i < ($q->rows()); $i++) {
252
-                $this->pending[	$q->field($i,"edit_id") ] = $q->row($i);
252
+                $this->pending[$q->field($i, "edit_id")] = $q->row($i);
253 253
             }
254 254
 
255 255
             $this->update_pending_count();
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             // the new epobject id and approval details.
362 362
             $q = $this->db->query("UPDATE editqueue
363 363
                             SET
364
-                            glossary_id='" .  $this->current_epobject_id. "',
364
+                            glossary_id='" .  $this->current_epobject_id . "',
365 365
                             editor_id='" . addslashes($THEUSER->user_id()) . "',
366 366
                             approved='1',
367 367
                             decided='" . $timestamp . "'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,8 @@
 block discarded – undo
91 91
 
92 92
             return $this->editqueue_id;
93 93
 
94
-        } else {
94
+        }
95
+        else {
95 96
             return false;
96 97
         }
97 98
     }
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/mps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     'body'=>''));
10 10
 ?>
11 11
 <p>
12
-    Vacher Dods charge <a href="http://www.dodonline.co.uk/engine.asp?showPage=article&id=2564"> 95 pounds </a> for this list of MPs names. We think democracy should be free. Click <?php echo '<a href="'.$csvurl.'">here</a>'; ?> to download a CSV (Comma Separated Values) file that you can load into Excel.
12
+    Vacher Dods charge <a href="http://www.dodonline.co.uk/engine.asp?showPage=article&id=2564"> 95 pounds </a> for this list of MPs names. We think democracy should be free. Click <?php echo '<a href="' . $csvurl . '">here</a>'; ?> to download a CSV (Comma Separated Values) file that you can load into Excel.
13 13
 </p>
14 14
 <?php
15 15
 $this->block_end();
Please login to merge, or discard this patch.