Completed
Pull Request — master (#1450)
by Nick
08:21 queued 03:29
created
www/includes/easyparliament/templates/html/divisions/_name_vote_list.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!function_exists('print_voter')) {
4
-  function print_voter($vote){
4
+  function print_voter($vote) {
5 5
     echo sprintf(
6 6
       '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s%s</span></li>',
7 7
       $vote['person_id'],
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     <?php if (count($tellers) > 0) { ?>
29 29
       <h4>Tellers</h4>
30 30
       <ul class="division-names">
31
-        <?php foreach($tellers as $teller) {
31
+        <?php foreach ($tellers as $teller) {
32 32
           print_voter($teller);
33 33
         } ?>
34 34
       </p>
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if (!function_exists('print_voter')) {
4
-  function print_voter($vote){
4
+    function print_voter($vote){
5 5
     echo sprintf(
6
-      '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s%s</span></li>',
7
-      $vote['person_id'],
8
-      $vote['name'],
9
-      $vote['party'],
10
-      $vote['proxy'] ? " (proxy vote cast by $vote[proxy])" : ''
6
+        '<li><a href="/mp/?p=%d">%s</a> <span class="party">%s%s</span></li>',
7
+        $vote['person_id'],
8
+        $vote['name'],
9
+        $vote['party'],
10
+        $vote['proxy'] ? " (proxy vote cast by $vote[proxy])" : ''
11 11
     );
12
-  }
12
+    }
13 13
 }
14 14
 
15 15
 if (count($votes) > 0) { ?>
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
       <?php $tellers = array(); ?>
19 19
       <ul class="division-names js-vote-accordion">
20 20
         <?php foreach ($votes as $vote) {
21
-          if ($vote['teller']) {
22
-              $tellers[] = $vote;
23
-          } else {
21
+            if ($vote['teller']) {
22
+                $tellers[] = $vote;
23
+            } else {
24 24
             print_voter($vote);
25
-          }
25
+            }
26 26
         } ?>
27 27
       </ul>
28 28
     <?php if (count($tellers) > 0) { ?>
29 29
       <h4>Tellers</h4>
30 30
       <ul class="division-names">
31 31
         <?php foreach($tellers as $teller) {
32
-          print_voter($teller);
32
+            print_voter($teller);
33 33
         } ?>
34 34
       </p>
35 35
     <?php } ?>
Please login to merge, or discard this patch.
www/includes/dbtypes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 // $Id: dbtypes.php,v 1.8 2009-04-28 13:13:04 matthew Exp $
4 4
 
5 5
 // The type field in the epobject database table
6
-define ('EPTYPE_HANSARD', 1);
7
-define ('EPTYPE_GLOSSARY', 2);
6
+define('EPTYPE_HANSARD', 1);
7
+define('EPTYPE_GLOSSARY', 2);
8 8
 
9 9
 // The major field in the hansard database table
10 10
 $hansardmajors = array(
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 );
122 122
 $hansardmajors[104] = $hansardmajors[4];
123 123
 
124
-$parties = array (
124
+$parties = array(
125 125
     'Bp'    => 'Bishop',
126 126
     'Con'   => 'Conservative',
127 127
     'CWM'   => 'Deputy Speaker',
Please login to merge, or discard this patch.
tests/HousesTest.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /**
10 10
      * Test that the Royal edge-case house is correctly defined.
11 11
      */
12
-	public function testRoyalHouseDefined()
12
+    public function testRoyalHouseDefined()
13 13
     {
14 14
         $this->assertEquals(0, HOUSE_TYPE_ROYAL);
15 15
     }
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     /**
18 18
      * Test that the House of Commons is correctly defined.
19 19
      */
20
-	public function testCommonsHouseDefined()
20
+    public function testCommonsHouseDefined()
21 21
     {
22 22
         $this->assertEquals(1, HOUSE_TYPE_COMMONS);
23 23
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     /**
26 26
      * Test that the House of Lords is correctly defined.
27 27
      */
28
-	public function testLordsHouseDefined()
28
+    public function testLordsHouseDefined()
29 29
     {
30 30
         $this->assertEquals(2, HOUSE_TYPE_LORDS);
31 31
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     /**
34 34
      * Test that the Northern Ireland Assembly is correctly defined.
35 35
      */
36
-	public function testNIHouseDefined()
36
+    public function testNIHouseDefined()
37 37
     {
38 38
         $this->assertEquals(3, HOUSE_TYPE_NI);
39 39
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     /**
42 42
      * Test that the Scottish Parliament is correctly defined.
43 43
      */
44
-	public function testScotlandHouseDefined()
44
+    public function testScotlandHouseDefined()
45 45
     {
46 46
         $this->assertEquals(4, HOUSE_TYPE_SCOTLAND);
47 47
     }
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * Test that the Assembly for Wales is correctly defined.
51 51
      */
52
-	public function testWalesHouseDefined()
52
+    public function testWalesHouseDefined()
53 53
     {
54 54
         $this->assertEquals(5, HOUSE_TYPE_WALES);
55 55
     }
56 56
 
57
-	/**
57
+    /**
58 58
      * Test that the London Assembly is correctly defined.
59 59
      */
60
-	public function testLondonAssemblyHouseDefined()
60
+    public function testLondonAssemblyHouseDefined()
61 61
     {
62 62
         $this->assertEquals(6, HOUSE_TYPE_LONDON_ASSEMBLY);
63 63
     }
Please login to merge, or discard this patch.
classes/Utility/House.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,24 +24,24 @@
 block discarded – undo
24 24
     public static function house_to_members($house) {
25 25
         $house_to_members = array(
26 26
             HOUSE_TYPE_COMMONS => array(
27
-              'singular' => 'MP',
28
-              'plural'   => 'MPs'
27
+                'singular' => 'MP',
28
+                'plural'   => 'MPs'
29 29
             ),
30 30
             HOUSE_TYPE_LORDS => array(
31
-              'singular' => 'Member of the House of Lords',
32
-              'plural'   => 'Members of the House of Lords'
31
+                'singular' => 'Member of the House of Lords',
32
+                'plural'   => 'Members of the House of Lords'
33 33
             ),
34 34
             HOUSE_TYPE_NI => array(
35
-              'singular' => 'MLA',
36
-              'plural'   => 'MLAs'
35
+                'singular' => 'MLA',
36
+                'plural'   => 'MLAs'
37 37
             ),
38 38
             HOUSE_TYPE_SCOTLAND => array(
39
-              'singular' => 'MSP',
40
-              'plural'   => 'MSPs'
41
-          ),
39
+                'singular' => 'MSP',
40
+                'plural'   => 'MSPs'
41
+            ),
42 42
             HOUSE_TYPE_LONDON_ASSEMBLY => array(
43
-              'singular' => 'Member of the London Assembly',
44
-              'plural'   => 'Members of the London Assembly'
43
+                'singular' => 'Member of the London Assembly',
44
+                'plural'   => 'Members of the London Assembly'
45 45
             )
46 46
         );
47 47
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,35 +50,35 @@
 block discarded – undo
50 50
 
51 51
     public static function getCountryDetails($house) {
52 52
         $details = array(
53
-            HOUSE_TYPE_COMMONS => array (
53
+            HOUSE_TYPE_COMMONS => array(
54 54
                 'country' => 'UK',
55 55
                 'assembly' => 'uk-commons',
56 56
                 'location' => '&ndash; in the House of Commons',
57 57
                 'cons_type' => 'WMC',
58 58
                 'assembly_name' => 'House of Commons',
59 59
             ),
60
-            HOUSE_TYPE_NI => array (
60
+            HOUSE_TYPE_NI => array(
61 61
                 'country' => 'NORTHERN IRELAND',
62 62
                 'assembly' => 'ni',
63 63
                 'location' => '&ndash; in the Northern Ireland Assembly',
64 64
                 'cons_type' => 'NIE',
65 65
                 'assembly_name' => 'Northern Ireland Assembly',
66 66
             ),
67
-            HOUSE_TYPE_SCOTLAND => array (
67
+            HOUSE_TYPE_SCOTLAND => array(
68 68
                 'country' => 'SCOTLAND',
69 69
                 'assembly' => 'scotland',
70 70
                 'location' => '&ndash; in the Scottish Parliament',
71 71
                 'cons_type' => 'SPC',
72 72
                 'assembly_name' => 'Scottish Parliament',
73 73
             ),
74
-            HOUSE_TYPE_LORDS => array (
74
+            HOUSE_TYPE_LORDS => array(
75 75
                 'country' => 'UK',
76 76
                 'assembly' => 'uk-lords',
77 77
                 'location' => '&ndash; in the House of Lords',
78 78
                 'cons_type' => '',
79 79
                 'assembly_name' => 'House of Lords',
80 80
             ),
81
-            HOUSE_TYPE_LORDS => array (
81
+            HOUSE_TYPE_LORDS => array(
82 82
                 'country' => 'UK',
83 83
                 'assembly' => 'london-assembly',
84 84
                 'location' => '&ndash; in the London Assembly',
Please login to merge, or discard this patch.
tests/PageTest.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $this->assertRegexp('#<span class="person-header__about__position__role">\s*Labour\s*MP\s*</span>#', $page);
35 35
     }
36 36
 
37
-	public function testSittingMLA()
37
+    public function testSittingMLA()
38 38
     {
39 39
         $page = $this->fetch_page( array( 'pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla' ) );
40 40
         $this->assertContains('Test Current-MLA', $page);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     /**
64 64
      * Ensure that the Speaker is given the correct constituency.
65 65
      */
66
-	public function testSpeaker()
66
+    public function testSpeaker()
67 67
     {
68 68
         $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) );
69 69
         $this->assertRegexp('#<span class="person-header__about__position__role">\s*Speaker\s*MP\s*</span>#', $page);
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public function getDataSet()
13 13
     {
14
-        return $this->createMySQLXMLDataSet(dirname(__FILE__).'/_fixtures/member.xml');
14
+        return $this->createMySQLXMLDataSet(dirname(__FILE__) . '/_fixtures/member.xml');
15 15
     }
16 16
 
17 17
     private function fetch_page($vars)
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 
22 22
     public function testQueenie()
23 23
     {
24
-        $page = $this->fetch_page( array( 'representative_type' => 'royal', 'n' => 'elizabeth_the_second' ) );
24
+        $page = $this->fetch_page(array('representative_type' => 'royal', 'n' => 'elizabeth_the_second'));
25 25
         $this->assertContains('Elizabeth the Second', $page);
26 26
         $this->assertContains('Coronated on 2 June 1953', $page);
27 27
     }
28 28
 
29 29
     public function testSittingMP()
30 30
     {
31
-        $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) );
31
+        $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency'));
32 32
         $this->assertContains('Test Current-MP', $page);
33 33
         $this->assertRegexp('#<span class="person-header__about__position__constituency">\s*Test Westminster Constituency\s*</span>#', $page);
34 34
         $this->assertRegexp('#<span class="person-header__about__position__role">\s*Labour\s*MP\s*</span>#', $page);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 	public function testSittingMLA()
38 38
     {
39
-        $page = $this->fetch_page( array( 'pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla' ) );
39
+        $page = $this->fetch_page(array('pid' => 4, 'representative_type' => 'mla', 'url' => '/mp/4/test_current-mla'));
40 40
         $this->assertContains('Test Current-MLA', $page);
41 41
         $this->assertRegexp('#<span class="person-header__about__position__constituency">\s*Test Northern Ireland Constituency\s*</span>#', $page);
42 42
         $this->assertRegexp('#<span class="person-header__about__position__role">\s*Sinn Féin\s*MLA\s*</span>#', $page);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function testSittingSinnFeinMP()
49 49
     {
50
-        $page = $this->fetch_page( array( 'pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency' ) );
50
+        $page = $this->fetch_page(array('pid' => 15, 'url' => '/mp/15/test_current-sf-mp/test_westminster_constituency'));
51 51
         $this->assertContains('Sinn F&eacute;in MPs do not take their seats in Parliament.', $page);
52 52
     }
53 53
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function testSittingNonSinnFeinMP()
58 58
     {
59
-        $page = $this->fetch_page( array( 'pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency' ) );
59
+        $page = $this->fetch_page(array('pid' => 2, 'url' => '/mp/2/test_current-mp/test_westminster_constituency'));
60 60
         $this->assertNotContains('Sinn F&eacute;in MPs do not take their seats in Parliament.', $page);
61 61
     }
62 62
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
 	public function testSpeaker()
67 67
     {
68
-        $page = $this->fetch_page( array( 'pid' => 13, 'url' => '/mp/13/test_speaker/buckingham' ) );
68
+        $page = $this->fetch_page(array('pid' => 13, 'url' => '/mp/13/test_speaker/buckingham'));
69 69
         $this->assertRegexp('#<span class="person-header__about__position__role">\s*Speaker\s*MP\s*</span>#', $page);
70 70
     }
71 71
 
@@ -75,25 +75,25 @@  discard block
 block discarded – undo
75 75
         # makes sure it is empty in case there's something hanging
76 76
         # about in memcached
77 77
         $banner->set_text('');
78
-        $page = $this->fetch_page( array( 'url' => '/' ) );
78
+        $page = $this->fetch_page(array('url' => '/'));
79 79
         $this->assertNotContains('<div class="banner">', $page);
80 80
         $this->assertNotContains('This is a banner', $page);
81 81
 
82 82
         $banner->set_text('This is a banner');
83
-        $page = $this->fetch_page( array( 'url' => '/' ) );
83
+        $page = $this->fetch_page(array('url' => '/'));
84 84
         $this->assertContains('This is a banner', $page);
85 85
 
86 86
         $banner->set_text('');
87
-        $page = $this->fetch_page( array( 'url' => '/' ) );
87
+        $page = $this->fetch_page(array('url' => '/'));
88 88
         $this->assertNotContains('<div class="banner">', $page);
89 89
         $this->assertNotContains('This is a banner', $page);
90 90
     }
91 91
 
92 92
     public function testNewMPMessage() {
93
-        $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) );
93
+        $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency'));
94 94
         $this->assertNotContains('is a recently elected MP', $page);
95 95
         $this->db->query('UPDATE member SET entered_house = NOW() WHERE person_id = 17');
96
-        $page = $this->fetch_page( array( 'pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency' ) );
96
+        $page = $this->fetch_page(array('pid' => 17, 'url' => '/mp/17/recent_mp/test_westminster_constituency'));
97 97
         $this->assertContains('is a recently elected MP', $page);
98 98
     }
99 99
 
Please login to merge, or discard this patch.