@@ -14,7 +14,7 @@ |
||
| 14 | 14 | } elseif ($constituency == "") { |
| 15 | 15 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode"; |
| 16 | 16 | twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
| 17 | - } else { |
|
| 17 | + } else { |
|
| 18 | 18 | $MEMBER = new MEMBER(array('constituency' => $constituency)); |
| 19 | 19 | if ($MEMBER->person_id()) { |
| 20 | 20 | // This will cookie the postcode. |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | include_once '../../includes/easyparliament/init.php'; |
| 4 | -include_once INCLUDESPATH."easyparliament/member.php"; |
|
| 4 | +include_once INCLUDESPATH . "easyparliament/member.php"; |
|
| 5 | 5 | |
| 6 | 6 | $pc = get_http_var('pc'); |
| 7 | 7 | $pc = preg_replace('#[^a-z0-9 ]#i', '', $pc); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $errors['pc'] = "Sorry, we couldn't check your postcode right now. Please use the 'All Mps' link above to browse MPs"; |
| 14 | 14 | } elseif ($constituency == "") { |
| 15 | 15 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a known postcode"; |
| 16 | - twfy_debug ('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
| 16 | + twfy_debug('MP', "Can't display an MP, as submitted postcode didn't match a constituency"); |
|
| 17 | 17 | } else { |
| 18 | 18 | $MEMBER = new MEMBER(array('constituency' => $constituency)); |
| 19 | 19 | if ($MEMBER->person_id()) { |
@@ -27,5 +27,5 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | } else { |
| 29 | 29 | $errors['pc'] = "Sorry, " . _htmlentities($pc) . " isn't a valid postcode"; |
| 30 | - twfy_debug ('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
| 30 | + twfy_debug('MP', "Can't display an MP because the submitted postcode wasn't of a valid form."); |
|
| 31 | 31 | } |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | $email = get_http_var('email'); |
| 17 | 17 | $sign = get_http_var('sign'); |
| 18 | 18 | $pid = get_http_var('pid'); |
| 19 | -if (!$pid || !ctype_digit($pid)) print 'not valid'; |
|
| 20 | -else { |
|
| 19 | +if (!$pid || !ctype_digit($pid)) { |
|
| 20 | + print 'not valid'; |
|
| 21 | +} else { |
|
| 21 | 22 | $authed = auth_verify_with_shared_secret($email, OPTION_AUTH_SHARED_SECRET, $sign); |
| 22 | 23 | if ($authed) { |
| 23 | 24 | $db = new ParlDB; |
@@ -26,10 +27,11 @@ discard block |
||
| 26 | 27 | ':criteria' => 'speaker:' . $pid |
| 27 | 28 | )); |
| 28 | 29 | $already_signed = $q->rows(); |
| 29 | - if ($already_signed) |
|
| 30 | - print "already signed"; |
|
| 31 | - else |
|
| 32 | - print "not signed"; |
|
| 30 | + if ($already_signed) { |
|
| 31 | + print "already signed"; |
|
| 32 | + } else { |
|
| 33 | + print "not signed"; |
|
| 34 | + } |
|
| 33 | 35 | } else { |
| 34 | 36 | print "not authed"; |
| 35 | 37 | } |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | <p>There are <b><?=number_format($debate_speeches)?></b> debate speeches (<?=number_format($debate_items)?> items including headers). |
| 39 | 39 | <br>There are <b><?=number_format($wrans_questions)?></b> written questions (<?=number_format($wrans_items)?> items including headers and answers). |
| 40 | 40 | |
| 41 | -<!-- Debate items / in-session day: <?=round($debate_items/$uniquedates,0)?> |
|
| 42 | -Wrans items / in-session day: <?=round($wrans_items/$uniquedates,0)?> --> |
|
| 41 | +<!-- Debate items / in-session day: <?=round($debate_items / $uniquedates, 0)?> |
|
| 42 | +Wrans items / in-session day: <?=round($wrans_items / $uniquedates, 0)?> --> |
|
| 43 | 43 | |
| 44 | -<p>Per sitting day, MPs are producing <b><?=round($debate_speeches/$uniquedates,0)?></b> speeches, and <b><?=round($wrans_questions/$uniquedates,0)?></b> written answers. |
|
| 44 | +<p>Per sitting day, MPs are producing <b><?=round($debate_speeches / $uniquedates, 0)?></b> speeches, and <b><?=round($wrans_questions / $uniquedates, 0)?></b> written answers. |
|
| 45 | 45 | </p> |
| 46 | 46 | |
| 47 | 47 | <?php |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | $DATA->set_page_metadata($this_page, 'title', 'Hansard'); |
| 8 | 8 | $DATA->set_page_metadata($this_page, 'meta_description', |
| 9 | - 'Find the complete Hansard on TheyWorkForYou.com - transcripts from all UK parliamentary debates in easily-searchable form.'); |
|
| 9 | + 'Find the complete Hansard on TheyWorkForYou.com - transcripts from all UK parliamentary debates in easily-searchable form.'); |
|
| 10 | 10 | $DATA->set_page_metadata($this_page, 'meta_keywords', "hansard, search hansard, hansard transcriptions, hansard record, parliamentary transcripts, parliament transcripts, parliament records, uk hansard, hansard uk, house of commons transcript, house of commons debates, house of commons records"); |
| 11 | 11 | |
| 12 | 12 | $PAGE->supress_heading = true; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $args = $people->getArgs(); |
| 19 | 19 | $people->setMetaData($args); |
| 20 | 20 | $data = $people->getData($args); |
| 21 | -if ( isset($args['f']) && $args['f'] == 'csv' ) { |
|
| 21 | +if (isset($args['f']) && $args['f'] == 'csv') { |
|
| 22 | 22 | $people->sendAsCSV($data); |
| 23 | 23 | } else { |
| 24 | 24 | MySociety\TheyWorkForYou\Renderer::output("people/index", $data); |
@@ -25,7 +25,9 @@ discard block |
||
| 25 | 25 | <?php |
| 26 | 26 | $c = 0; |
| 27 | 27 | foreach ($all_news as $id => $news_row) { |
| 28 | - if ($c++ == 10) break; |
|
| 28 | + if ($c++ == 10) { |
|
| 29 | + break; |
|
| 30 | + } |
|
| 29 | 31 | list($title, $content, $date) = $news_row; |
| 30 | 32 | $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
| 31 | 33 | print "<rdf:li rdf:resource=\"$url\" />\n"; |
@@ -39,7 +41,9 @@ discard block |
||
| 39 | 41 | <?php |
| 40 | 42 | $c = 0; |
| 41 | 43 | foreach ($all_news as $id => $news_row) { |
| 42 | - if ($c++ == 10) break; |
|
| 44 | + if ($c++ == 10) { |
|
| 45 | + break; |
|
| 46 | + } |
|
| 43 | 47 | list($title, $content, $date) = $news_row; |
| 44 | 48 | $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
| 45 | 49 | $excerpt = trim_characters(news_format_body($content), 0, 250); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | foreach ($all_news as $id => $news_row) { |
| 28 | 28 | if ($c++ == 10) break; |
| 29 | 29 | list($title, $content, $date) = $news_row; |
| 30 | - $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
|
| 30 | + $url = "https://www.theyworkforyou.com" . news_individual_link($date, $title); |
|
| 31 | 31 | print "<rdf:li rdf:resource=\"$url\" />\n"; |
| 32 | 32 | } |
| 33 | 33 | ?> |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | foreach ($all_news as $id => $news_row) { |
| 42 | 42 | if ($c++ == 10) break; |
| 43 | 43 | list($title, $content, $date) = $news_row; |
| 44 | - $url = "https://www.theyworkforyou.com".news_individual_link($date, $title); |
|
| 44 | + $url = "https://www.theyworkforyou.com" . news_individual_link($date, $title); |
|
| 45 | 45 | $excerpt = trim_characters(news_format_body($content), 0, 250); |
| 46 | 46 | $date = str_replace(" ", "T", $date) . "+00:00"; |
| 47 | 47 | ?> |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | function api_getComments_start_date($start_date) { |
| 27 | - $args = array ( |
|
| 27 | + $args = array( |
|
| 28 | 28 | 'start_date' => $start_date, |
| 29 | 29 | 'end_date' => get_http_var('end_date') |
| 30 | 30 | ); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | function api_getComments_search($s) { |
| 36 | - $args = array ( |
|
| 36 | + $args = array( |
|
| 37 | 37 | 's' => $s, |
| 38 | 38 | 'p' => get_http_var('page'), |
| 39 | 39 | 'num' => get_http_var('num'), |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | $this_page = 'bill_index'; |
| 4 | 4 | include_once '../../../../includes/easyparliament/init.php'; |
| 5 | -$DATA->set_page_metadata($this_page, 'heading','Identity Cards Act 2006'); |
|
| 5 | +$DATA->set_page_metadata($this_page, 'heading', 'Identity Cards Act 2006'); |
|
| 6 | 6 | |
| 7 | 7 | $PAGE->page_start(); |
| 8 | 8 | $PAGE->stripe_start(); |
| 9 | 9 | |
| 10 | -$PAGE->block_start(array ('title'=>'House of Commons - Normal Run')); |
|
| 10 | +$PAGE->block_start(array('title'=>'House of Commons - Normal Run')); |
|
| 11 | 11 | ?> |
| 12 | 12 | <ul> <li>Back on 25th May 2005, a bill was introduced: the <a |
| 13 | 13 | href="http://www.publications.parliament.uk/pa/cm200506/cmbills/009/2006009.htm">Identity |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | <?php |
| 34 | 34 | $PAGE->block_end(); |
| 35 | -$PAGE->block_start(array ('title'=>'House of Lords - Normal Run')); |
|
| 35 | +$PAGE->block_start(array('title'=>'House of Lords - Normal Run')); |
|
| 36 | 36 | ?> |
| 37 | 37 | |
| 38 | 38 | <ul> |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | <?php |
| 51 | 51 | $PAGE->block_end(); |
| 52 | -$PAGE->block_start(array ('title'=>'Ping Pong')); |
|
| 52 | +$PAGE->block_start(array('title'=>'Ping Pong')); |
|
| 53 | 53 | ?> |
| 54 | 54 | |
| 55 | 55 | <ul> |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $PAGE->block_end(); |
| 95 | 95 | |
| 96 | 96 | $includes = array( |
| 97 | - array ( |
|
| 97 | + array( |
|
| 98 | 98 | 'type' => 'include', |
| 99 | 99 | 'content' => 'bills_intro' |
| 100 | 100 | ), |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | 102 | $expectedTable = $this->createXmlDataSet(dirname(__FILE__).'/_fixtures/expectedTokens.xml') |
| 103 | - ->getTable("tokens"); |
|
| 103 | + ->getTable("tokens"); |
|
| 104 | 104 | $this->assertTablesEqual($expectedTable, $queryTable); |
| 105 | 105 | |
| 106 | 106 | $alertCount = $this->getConnection()->getRowCount('alerts', 'email = "[email protected]"'); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function getDataSet() |
| 13 | 13 | { |
| 14 | - return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/user.xml'); |
|
| 14 | + return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/user.xml'); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | $id = $u->user_id(); |
| 44 | 44 | $u->init($id); |
| 45 | 45 | |
| 46 | - $this->assertEquals( 'Test', $u->firstname() ); |
|
| 47 | - $this->assertEquals( 'EH1 99SP', $u->postcode() ); |
|
| 46 | + $this->assertEquals('Test', $u->firstname()); |
|
| 47 | + $this->assertEquals('EH1 99SP', $u->postcode()); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function testEditUser() { |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | $u = new THEUSER(); |
| 53 | 53 | $u->loggedin = 1; |
| 54 | 54 | |
| 55 | - $this->assertEquals( 'Test', $u->firstname() ); |
|
| 55 | + $this->assertEquals('Test', $u->firstname()); |
|
| 56 | 56 | |
| 57 | - $d = $u->update_self( array( |
|
| 57 | + $d = $u->update_self(array( |
|
| 58 | 58 | 'firstname' => 'Experiment', |
| 59 | 59 | 'lastname' => 'User', |
| 60 | 60 | 'postcode' => 'EH1 99SP', |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | 'url' => '', |
| 63 | 63 | 'optin' => '', |
| 64 | 64 | 'user_id' => 1 |
| 65 | - ) ); |
|
| 65 | + )); |
|
| 66 | 66 | |
| 67 | - $this->assertEquals( 'Experiment', $u->firstname() ); |
|
| 67 | + $this->assertEquals('Experiment', $u->firstname()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function testEditUserEmail() { |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | $u = new THEUSER(); |
| 73 | 73 | $u->loggedin = 1; |
| 74 | 74 | |
| 75 | - $this->assertEquals( '[email protected]', $u->email() ); |
|
| 75 | + $this->assertEquals('[email protected]', $u->email()); |
|
| 76 | 76 | |
| 77 | - $d = $u->update_self( array( |
|
| 77 | + $d = $u->update_self(array( |
|
| 78 | 78 | 'firstname' => 'Experiment', |
| 79 | 79 | 'lastname' => 'User', |
| 80 | 80 | 'email' => '[email protected]', |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | 'url' => '', |
| 84 | 84 | 'optin' => '', |
| 85 | 85 | 'user_id' => 1 |
| 86 | - ), false ); |
|
| 86 | + ), false); |
|
| 87 | 87 | |
| 88 | 88 | // email should not change as user needs to confirm |
| 89 | - $this->assertEquals( '[email protected]', $u->email() ); |
|
| 89 | + $this->assertEquals('[email protected]', $u->email()); |
|
| 90 | 90 | |
| 91 | 91 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
| 92 | 92 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | 'tokens', 'SELECT type, data FROM tokens WHERE data = "1::[email protected]"' |
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | - $expectedTable = $this->createXmlDataSet(dirname(__FILE__).'/_fixtures/expectedTokens.xml') |
|
| 99 | + $expectedTable = $this->createXmlDataSet(dirname(__FILE__) . '/_fixtures/expectedTokens.xml') |
|
| 100 | 100 | ->getTable("tokens"); |
| 101 | 101 | $this->assertTablesEqual($expectedTable, $queryTable); |
| 102 | 102 | |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | $tokenRow = $queryTable->getRow(0); |
| 111 | 111 | $token = '2-' . $tokenRow['token']; |
| 112 | 112 | |
| 113 | - $u->confirm_email($token,false); |
|
| 113 | + $u->confirm_email($token, false); |
|
| 114 | 114 | |
| 115 | - $this->assertEquals( '[email protected]', $u->email(), 'confirming with token updates email address' ); |
|
| 115 | + $this->assertEquals('[email protected]', $u->email(), 'confirming with token updates email address'); |
|
| 116 | 116 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
| 117 | 117 | $this->assertEquals(0, $tokenCount, 'token deleted once email confirmed'); |
| 118 | 118 | |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | $u = new THEUSER(); |
| 129 | 129 | $u->loggedin = 1; |
| 130 | 130 | |
| 131 | - $this->assertEquals( '[email protected]', $u->email(), 'confirming inital email address' ); |
|
| 131 | + $this->assertEquals('[email protected]', $u->email(), 'confirming inital email address'); |
|
| 132 | 132 | |
| 133 | 133 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
| 134 | 134 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |
| 135 | 135 | |
| 136 | 136 | $token = '2-lkdsjafhsadjhf'; |
| 137 | 137 | |
| 138 | - $u->confirm_email($token,false); |
|
| 139 | - $this->assertEquals( '[email protected]', $u->email(), 'expired token does not update email address' ); |
|
| 138 | + $u->confirm_email($token, false); |
|
| 139 | + $this->assertEquals('[email protected]', $u->email(), 'expired token does not update email address'); |
|
| 140 | 140 | |
| 141 | 141 | $tokenCount = $this->getConnection()->getRowCount('tokens', 'data = "1::[email protected]"'); |
| 142 | 142 | $this->assertEquals(1, $tokenCount, 'correct number of email confirm tokens'); |