Passed
Pull Request — master (#1932)
by Struan
04:54
created
www/includes/easyparliament/metadata.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 */
68 68
 
69
-$page =  [
69
+$page = [
70 70
 
71 71
     // Things used on EVERY page, unless overridden for a page:
72 72
     'default' =>  [
@@ -498,24 +498,24 @@  discard block
 block discarded – undo
498 498
         'url'			=> 'glossary/',
499 499
     ],
500 500
     'glossary_addterm' => [
501
-        'menu'			=> array (
501
+        'menu'			=> array(
502 502
             'text'			=> 'Add a term',
503 503
             'title'			=> "Add a definition for a term to the glossary"
504 504
         ),
505 505
         'parent'		=> 'help_us_out',
506 506
         'title'			=> 'Add a glossary item',
507 507
         'url'			=> 'addterm/',
508
-        'session_vars'	=> array ('g')
508
+        'session_vars'	=> array('g')
509 509
     ],
510 510
     'glossary_addlink' => [
511
-        'menu'			=> array (
511
+        'menu'			=> array(
512 512
             'text'			=> 'Add a link',
513 513
             'title'			=> "Add an external link"
514 514
         ),
515 515
         'parent'		=> 'help_us_out',
516 516
         'title'			=> 'Add a link',
517 517
         'url'			=> 'addlink/',
518
-        'session_vars'	=> array ('g')
518
+        'session_vars'	=> array('g')
519 519
     ],
520 520
     'glossary_item' => [
521 521
         'heading'		=> 'Glossary heading',
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 // The text displayed on the page itself will also be this,
1362 1362
 // UNLESS the section has a 'heading', in which case that's used instead.
1363 1363
 
1364
-$section =  [
1364
+$section = [
1365 1365
 
1366 1366
 
1367 1367
     'about' =>  [
Please login to merge, or discard this patch.
www/includes/easyparliament/glossary.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 include_once INCLUDESPATH . "easyparliament/searchengine.php";
25 25
 
26 26
 class GLOSSARY {
27
-    public $num_terms;			// how many glossary entries do we have
27
+    public $num_terms; // how many glossary entries do we have
28 28
     // (changes depending on how GLOSSARY is called
29
-    public $hansard_count;		// how many times does the phrase appear in hansard?
30
-    public $query;				// search term
31
-    public $glossary_id;		// if this is set then we only have 1 glossary term
32
-    public $current_term;		// will only be set if we have a valid epobject_id
29
+    public $hansard_count; // how many times does the phrase appear in hansard?
30
+    public $query; // search term
31
+    public $glossary_id; // if this is set then we only have 1 glossary term
32
+    public $current_term; // will only be set if we have a valid epobject_id
33 33
     public $current_letter;
34 34
 
35 35
     // constructor...
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         // These stop stupid submissions.
74 74
         // everything should be lowercase.
75
-        $this->stopwords = [ "the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate" ];
75
+        $this->stopwords = ["the", "of", "to", "and", "for", "in", "a", "on", "is", "that", "will", "secretary", "are", "ask", "state", "have", "be", "has", "by", "with", "i", "not", "what", "as", "it", "hon", "he", "which", "from", "if", "been", "this", "s", "we", "at", "government", "was", "my", "an", "department", "there", "make", "or", "made", "their", "all", "but", "they", "how", "debate"];
76 76
 
77 77
     }
78 78
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         global $THEUSER;
190 190
 
191 191
         if (!$THEUSER->is_able_to('addterm')) {
192
-            error ("Sorry, you are not allowed to add Glossary terms.");
192
+            error("Sorry, you are not allowed to add Glossary terms.");
193 193
             return false;
194 194
         }
195 195
 
Please login to merge, or discard this patch.
www/docs/addlink/index.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
     <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once INCLUDESPATH."easyparliament/glossary.php";
5
-include_once INCLUDESPATH."easyparliament/glossarylist.php";
4
+include_once INCLUDESPATH . "easyparliament/glossary.php";
5
+include_once INCLUDESPATH . "easyparliament/glossarylist.php";
6 6
 
7 7
 $this_page = "glossary_addlink";
8 8
 
9
-$args = array( 'action' => $this_page);
9
+$args = array('action' => $this_page);
10 10
 
11 11
 // First things first...
12 12
 
13
-if ((get_http_var('g') != '') && (get_http_var('previewterm') == '') ) {
13
+if ((get_http_var('g') != '') && (get_http_var('previewterm') == '')) {
14 14
     // We're searching for something.
15 15
     $args['s'] = filter_user_input(get_http_var('g'), 'strict');
16 16
     $GLOSSARY = new GLOSSARY($args);
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 $PAGE->stripe_start();
27 27
 
28
-$data = array (
28
+$data = array(
29 29
     'title' => get_http_var('g'),
30 30
     'body'	=> get_http_var('definition')
31 31
 );
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 
116 116
     $PAGE->glossary_atoz($GLOSSARY);
117 117
 
118
-    $PAGE->stripe_end(array (
119
-        array (
118
+    $PAGE->stripe_end(array(
119
+        array(
120 120
             'type'		=> 'include',
121 121
             'content'	=> 'glossary_add'
122 122
         )
Please login to merge, or discard this patch.
www/docs/addterm/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include_once '../../includes/easyparliament/init.php';
4
-include_once INCLUDESPATH."easyparliament/glossary.php";
5
-include_once INCLUDESPATH."easyparliament/glossarylist.php";
4
+include_once INCLUDESPATH . "easyparliament/glossary.php";
5
+include_once INCLUDESPATH . "easyparliament/glossarylist.php";
6 6
 
7 7
 $view = new MySociety\TheyWorkForYou\GlossaryView\AddTermView();
8 8
 $data = $view->display();
Please login to merge, or discard this patch.
www/docs/parsing/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 $html = RAWDATA . 'cmpages/';
16 16
 $xml = RAWDATA . 'scrapedxml/';
17 17
 $dir = array('debates', 'wrans', 'wms', 'westminhall', 'lordspages', 'ni');
18
-$majors = array(1,3,4,2,101,5);
18
+$majors = array(1, 3, 4, 2, 101, 5);
19 19
 
20 20
 $hdates = array();
21 21
 $db = new ParlDB;
22 22
 $q = $db->query('SELECT DISTINCT(hdate) AS hdate, major FROM hansard');
23
-for ($i=0; $i<$q->rows(); $i++) {
23
+for ($i = 0; $i < $q->rows(); $i++) {
24 24
     $hdates[$q->field($i, 'hdate')][$q->field($i, 'major')] = true;
25 25
 }
26 26
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     $out = array();
37 37
     $dh = opendir("$html$bit/");
38 38
     while (false !== ($filename = readdir($dh))) {
39
-        if (substr($filename, -5)!='.html' || substr($filename, -8, 3)=='tmp') continue;
39
+        if (substr($filename, -5) != '.html' || substr($filename, -8, 3) == 'tmp') continue;
40 40
         #if ($bit=='lordspages' && substr($filename,7,4)!='2005') continue;
41 41
         preg_match('#^(.*?)(\d\d\d\d-\d\d-\d\d)(.*?)\.#', $filename, $m);
42 42
         $part = ucfirst($m[1]); $date = $m[2]; $version = $m[3];
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
         $stat = stat("$html$bit/$filename");
45 45
         $base = substr($filename, 0, -5);
46 46
         if (!is_file("$xml$bit/$base.xml")) {
47
-            if ($date>'2001-05-11')
48
-                $out[$date][] = "<li>$date : $part version $version, size $stat[7] bytes, last modified ".date('Y-m-d H:i:s', $stat[9])."</li>\n";
47
+            if ($date > '2001-05-11')
48
+                $out[$date][] = "<li>$date : $part version $version, size $stat[7] bytes, last modified " . date('Y-m-d H:i:s', $stat[9]) . "</li>\n";
49 49
         } else {
50 50
             if (!array_key_exists($date, $hdates) || !array_key_exists($majors[$k], $hdates[$date])) {
51 51
                 $notloaded .= "<li>$date : $part version $version</li>\n";
Please login to merge, or discard this patch.
www/docs/glossary/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     $URL->update(["gl" => $GLOSSARY->next_term['glossary_id']]);
77 77
     $next_link = $URL->generate('url');
78 78
 
79
-    $nextprev =  [
79
+    $nextprev = [
80 80
         'next'	=>  [
81 81
             'url'	=> $next_link,
82 82
             'title'	=> 'Next term',
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 $URL = new \MySociety\TheyWorkForYou\Url('glossary_addterm');
119 119
 $add_url = $URL->generate();
120
-print "<p>Think you know a phrase that should be here? Help us improve the site by <a href=\"".$add_url."\">adding it</a>.</p>";
120
+print "<p>Think you know a phrase that should be here? Help us improve the site by <a href=\"" . $add_url . "\">adding it</a>.</p>";
121 121
 
122 122
 $PAGE->stripe_end([
123 123
     [
Please login to merge, or discard this patch.