Failed Conditions
Push — master ( 06b6d2...e429cf )
by Nick
06:33
created
www/includes/easyparliament/templates/html/hansard_search_video.php 1 patch
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.
www/includes/easyparliament/templates/html/glossary.php 1 patch
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.
www/includes/easyparliament/templates/api/comments.php 1 patch
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.
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.
www/includes/easyparliament/sidebars/calendar_future.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 list($firstyear, $firstmonth, $day) = explode('-', $min_future_date);
34 34
 list($finalyear, $finalmonth, $day) = explode('-', $max_future_date);
35 35
 
36
-$q =  $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
36
+$q = $db->query("SELECT DISTINCT(event_date) AS event_date FROM future
37 37
     WHERE event_date >= :firstdate
38 38
     AND event_date <= :finaldate
39 39
     AND deleted = 0
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 if ($q->rows() > 0) {
47 47
     $years = array();
48
-    for ($row=0; $row<$q->rows(); $row++) {
48
+    for ($row = 0; $row < $q->rows(); $row++) {
49 49
         list($year, $month, $day) = explode('-', $q->field($row, 'event_date'));
50 50
         $month = intval($month);
51 51
         $years[$year][$month][] = intval($day);
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/minisurvey.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 if ($hide_question) {
34 34
     $always_ask = 0;
35 35
     $show_survey_qn = $current_question;
36
-    setcookie('survey', $current_question, time()+60*60*24*365, '/');
36
+    setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/');
37 37
 } elseif ($has_answered_question == $current_question && !$always_ask) {
38 38
     $show_survey_qn = $current_question;
39
-    setcookie('survey', $current_question, time()+60*60*24*365, '/');
39
+    setcookie('survey', $current_question, time() + 60 * 60 * 24 * 365, '/');
40 40
 } elseif (isset($_COOKIE['survey'])) {
41 41
     $show_survey_qn = $_COOKIE['survey'];
42 42
 }
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
 if ($show_survey_qn < $current_question && !$has_answered_question) {
50 50
     $page_url = '';
51 51
     $hide_url = '';
52
-    if ( in_array( $this_page, array('mp', 'peer', 'msp', 'mla', 'royal') ) ) {
52
+    if (in_array($this_page, array('mp', 'peer', 'msp', 'mla', 'royal'))) {
53 53
         global $MEMBER;
54 54
         $page_url = $MEMBER->url(true) . "?answered_survey=$current_question";
55 55
         $hide_url = $MEMBER->url() . "?hide_survey=$current_question";
56 56
     } else {
57 57
         $URL = new URL($this_page);
58
-        $URL->insert(array('answered_survey' => $current_question ));
58
+        $URL->insert(array('answered_survey' => $current_question));
59 59
         $page_url = 'https://' . DOMAIN . $URL->generate();
60 60
         $URL = new URL($this_page);
61
-        $URL->insert(array('hide_survey' => $current_question ));
61
+        $URL->insert(array('hide_survey' => $current_question));
62 62
         $hide_url = $URL->generate();
63 63
     }
64 64
 
Please login to merge, or discard this patch.
www/includes/easyparliament/commentreportlist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         // available for editing, it's accurate.
25 25
         $this->_update_locked();
26 26
 
27
-        $data = $this->_get_data_by_recent ();
27
+        $data = $this->_get_data_by_recent();
28 28
 
29 29
         $this->render($data);
30 30
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 
100 100
         if ($q->rows() > 0) {
101 101
 
102
-            for ($n=0; $n<$q->rows(); $n++) {
102
+            for ($n = 0; $n < $q->rows(); $n++) {
103 103
 
104
-                $data[] = array (
105
-                    'report_id'		=> $q->field($n,'report_id'),
106
-                    'comment_id' 	=> $q->field($n,'comment_id'),
104
+                $data[] = array(
105
+                    'report_id'		=> $q->field($n, 'report_id'),
106
+                    'comment_id' 	=> $q->field($n, 'comment_id'),
107 107
                     'firstname'		=> $q->field($n, 'firstname'),
108 108
                     'lastname'		=> $q->field($n, 'lastname'),
109 109
                     'body'			=> $q->field($n, 'body'),
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
         }
116 116
         if ($r->rows() > 0) {
117
-            for ($n=0; $n<$r->rows(); $n++) {
118
-                $data[] = array (
119
-                    'report_id'		=> $r->field($n,'report_id'),
120
-                    'comment_id' 	=> $r->field($n,'comment_id'),
117
+            for ($n = 0; $n < $r->rows(); $n++) {
118
+                $data[] = array(
119
+                    'report_id'		=> $r->field($n, 'report_id'),
120
+                    'comment_id' 	=> $r->field($n, 'comment_id'),
121 121
                     'firstname'		=> $r->field($n, 'firstname'),
122 122
                     'lastname'		=> $r->field($n, 'lastname'),
123 123
                     'body'			=> $r->field($n, 'body'),
Please login to merge, or discard this patch.
tests/UserPageTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
      */
9 9
     public function getDataSet()
10 10
     {
11
-        return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/user.xml');
11
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/user.xml');
12 12
     }
13 13
 
14 14
     private function fetch_page($vars)
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
         return $this->base_fetch_page($vars, 'user');
17 17
     }
18 18
 
19
-    private function fetch_user_page( $vars = array(), $page = 'user' )
19
+    private function fetch_user_page($vars = array(), $page = 'user')
20 20
     {
21
-        return $this->base_fetch_page_user( $vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page );
21
+        return $this->base_fetch_page_user($vars, '1.fbb689a0c092f5534b929d302db2c8a9', $page);
22 22
     }
23 23
 
24 24
     public function testLoginPageLoads()
25 25
     {
26
-        $page = $this->base_fetch_page( array(), 'user/login' );
26
+        $page = $this->base_fetch_page(array(), 'user/login');
27 27
         $this->assertContains('Sign in', $page);
28 28
     }
29 29
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             'password' => 'password',
35 35
             'submitted' => 'true',
36 36
         );
37
-        $page = $this->base_fetch_page( $vars, 'user/login' );
37
+        $page = $this->base_fetch_page($vars, 'user/login');
38 38
         # it's a redirect which means we should get nothing
39 39
         # as we're using the cli version of php :(
40 40
         $this->assertEquals('', $page);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function testEditUserInfo()
51 51
     {
52
-        $page = $this->fetch_user_page( array('pg' => 'edit' ) );
52
+        $page = $this->fetch_user_page(array('pg' => 'edit'));
53 53
         $this->assertContains('Your details', $page);
54 54
         $this->assertContains('name="pg" value="edit"', $page);
55 55
         $this->assertContains('value="Test"', $page);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'email' => '[email protected]',
63 63
             'submitted' => 'true',
64 64
         );
65
-        $page = $this->fetch_user_page( $vars );
65
+        $page = $this->fetch_user_page($vars);
66 66
         $this->assertContains('Example User', $page);
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
tests/FetchPageTestCase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     protected function base_fetch_page($vars, $dir, $page = 'index.php', $req_uri = '')
10 10
     {
11 11
         foreach ($vars as $k => $v) {
12
-            $vars[$k] =  $k . '=' . urlencode($v);
12
+            $vars[$k] = $k . '=' . urlencode($v);
13 13
         }
14 14
 
15 15
         if (!$req_uri) {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     protected function base_fetch_page_user($vars, $cookie, $dir, $page = 'index.php', $req_uri = '')
27 27
     {
28 28
         foreach ($vars as $k => $v) {
29
-            $vars[$k] =  $k . '=' . urlencode($v);
29
+            $vars[$k] = $k . '=' . urlencode($v);
30 30
         }
31 31
 
32 32
         if (!$req_uri) {
Please login to merge, or discard this patch.