@@ -17,17 +17,17 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | private function fetch_division_page() { |
20 | - return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) ); |
|
20 | + return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 363, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions')); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | private function fetch_mp_recent_page() |
24 | 24 | { |
25 | - $vars = array( 'pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent' ); |
|
25 | + $vars = array('pagetype' => 'recent', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/recent'); |
|
26 | 26 | return $this->base_fetch_page($vars, 'mp', 'index.php', '/mp/recent.php'); |
27 | 27 | } |
28 | 28 | |
29 | 29 | private function fetch_recent_page() { |
30 | - return $this->base_fetch_page( array('url' => '/divisions' ), 'divisions', 'index.php', '/divisions/index.php' ); |
|
30 | + return $this->base_fetch_page(array('url' => '/divisions'), 'divisions', 'index.php', '/divisions/index.php'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | public function testNotEnoughInfoStatement() { |
116 | - return $this->fetch_page( array( 'pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions' ) ); |
|
116 | + return $this->fetch_page(array('pagetype' => 'divisions', 'pid' => 2, 'policy' => 810, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/divisions')); |
|
117 | 117 | $this->assertContains('we don’t have enough information to calculate Test Current-MP’s position', $page); |
118 | 118 | } |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | public function testSingleDivision() { |
127 | - $page = $this->base_fetch_page( array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons' ), 'divisions', 'division.php', '/divisions/division.php' ); |
|
127 | + $page = $this->base_fetch_page(array('url' => '/divisions/division.php', 'vote' => 'pw-3012-01-01-1-commons'), 'divisions', 'division.php', '/divisions/division.php'); |
|
128 | 128 | $this->assertContains('A majority of MPs <b>voted in favour</b> of a thing', $page); |
129 | 129 | $this->assertContains('198 for', $page); |
130 | 130 | $this->assertContains('98 against', $page); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/people.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/people.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/hansard.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/hansard.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | private function fetch_votes_page() { |
20 | - return $this->fetch_page( array( 'pagetype' => 'votes', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/votes' ) ); |
|
20 | + return $this->fetch_page(array('pagetype' => 'votes', 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency/votes')); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function testVoteSummary() { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/acceptance.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/acceptance.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | private function fetch_page($path, $file = 'index.php', $vars = array()) |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function getDataSet() |
13 | 13 | { |
14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/alerts.xml'); |
|
14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/alerts.xml'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $ALERT = new ALERT(); |
33 | 33 | |
34 | - $response = $ALERT->fetch(0,0); |
|
34 | + $response = $ALERT->fetch(0, 0); |
|
35 | 35 | |
36 | 36 | // Make sure we only get one response |
37 | 37 | $this->assertEquals(1, count($response['data'])); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $ALERT = new ALERT(); |
50 | 50 | |
51 | - $response = $ALERT->fetch(1,0); |
|
51 | + $response = $ALERT->fetch(1, 0); |
|
52 | 52 | |
53 | 53 | // Make sure we only get two responses |
54 | 54 | $this->assertEquals(2, count($response['data'])); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $ALERT = new ALERT(); |
67 | 67 | |
68 | - $response = $ALERT->fetch(0,1); |
|
68 | + $response = $ALERT->fetch(0, 1); |
|
69 | 69 | |
70 | 70 | // Make sure we only get one response |
71 | 71 | $this->assertEquals(1, count($response['data'])); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | $ALERT = new ALERT(); |
84 | 84 | |
85 | - $response = $ALERT->fetch(1,1); |
|
85 | + $response = $ALERT->fetch(1, 1); |
|
86 | 86 | |
87 | 87 | // Make sure we only get one response |
88 | 88 | $this->assertEquals(1, count($response['data'])); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $ALERT = new ALERT(); |
101 | 101 | |
102 | - $response = $ALERT->fetch_between(1,1, '2014-02-01', '2014-02-02'); |
|
102 | + $response = $ALERT->fetch_between(1, 1, '2014-02-01', '2014-02-02'); |
|
103 | 103 | |
104 | 104 | // Make sure we only get one response |
105 | 105 | $this->assertEquals(1, count($response['alerts'])); |
@@ -6,17 +6,17 @@ |
||
6 | 6 | $policies = new MySociety\TheyWorkForYou\Policies; |
7 | 7 | |
8 | 8 | $party_count = 0; |
9 | -foreach ( $parties as $party ) { |
|
9 | +foreach ($parties as $party) { |
|
10 | 10 | $party = new MySociety\TheyWorkForYou\Party($party); |
11 | 11 | |
12 | 12 | $positions = $party->calculateAllPolicyPositions($policies); |
13 | 13 | |
14 | - if ( count( $positions ) ) { |
|
14 | + if (count($positions)) { |
|
15 | 15 | $party_count++; |
16 | 16 | } |
17 | 17 | |
18 | - foreach ( $positions as $position ) { |
|
19 | - $party->cache_position( $position ); |
|
18 | + foreach ($positions as $position) { |
|
19 | + $party->cache_position($position); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 |
@@ -22,7 +22,8 @@ |
||
22 | 22 | if ($start_date == $end_date) { |
23 | 23 | $qq = $db->query("update hansard set video_status = video_status | 1 |
24 | 24 | where hdate='$start_date' and htime>='$start_time' and htime<'$end_time' and major=1"); |
25 | - } else { |
|
25 | + } |
|
26 | + else { |
|
26 | 27 | $qq = $db->query("update hansard set video_status = video_status | 1 |
27 | 28 | where ((hdate='$start_date' and htime>='$start_time') |
28 | 29 | or (hdate='$end_date' and htime<'$end_time')) and major=1"); |
@@ -5,12 +5,12 @@ discard block |
||
5 | 5 | $this_page = 'trackback'; |
6 | 6 | |
7 | 7 | // The gid is the gid of the thing being trackedback to. |
8 | -$epobject_id= get_http_var('e'); // eg, '3424' |
|
8 | +$epobject_id = get_http_var('e'); // eg, '3424' |
|
9 | 9 | |
10 | -$url = get_http_var('url'); |
|
10 | +$url = get_http_var('url'); |
|
11 | 11 | $blog_name = get_http_var('blog_name'); |
12 | -$title = get_http_var('title'); |
|
13 | -$excerpt = get_http_var('excerpt'); |
|
12 | +$title = get_http_var('title'); |
|
13 | +$excerpt = get_http_var('excerpt'); |
|
14 | 14 | |
15 | 15 | if ($title == '' && $url == '' && $blog_name == '') { |
16 | 16 | // If it doesn't look like a trackback at all... |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | exit; |
24 | 24 | } |
25 | 25 | |
26 | -if ((strlen(''.$epobject_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$url))) { |
|
26 | +if ((strlen('' . $epobject_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen('' . $url))) { |
|
27 | 27 | |
28 | 28 | header('Content-Type: text/xml'); |
29 | 29 | |
30 | - $trackbackdata = array ( |
|
30 | + $trackbackdata = array( |
|
31 | 31 | 'epobject_id' => $epobject_id, |
32 | 32 | 'url' => $url, |
33 | 33 | 'blog_name' => $blog_name, |