Completed
Pull Request — master (#1474)
by Nick
34:21
created
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' => '– 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' => '– 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' => '– 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' => '– in the House of Lords',
78 78
                 'cons_type' => '',
79 79
                 'assembly_name' => 'House of Lords',
80 80
             ),
81
-            HOUSE_TYPE_LONDON_ASSEMBLY => array (
81
+            HOUSE_TYPE_LONDON_ASSEMBLY => array(
82 82
                 'country' => 'UK',
83 83
                 'assembly' => 'london-assembly',
84 84
                 'location' => '– 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.
www/includes/easyparliament/templates/html/london/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
                 <div class="row nested-row">
42 42
                     <div class="homepage-in-the-news homepage-content-section">
43 43
                         <?php if ( $featured ) {
44
-                             include dirname(__FILE__) . "/../homepage/featured.php";
44
+                                include dirname(__FILE__) . "/../homepage/featured.php";
45 45
                         } ?>
46 46
                     </div>
47 47
                     <div class="homepage-create-alert homepage-content-section">
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
             <div class="hero__mp-search__wrap">
5 5
                 <h1>Do your Assembly Members represent you?</h1>
6 6
                 <div class="row collapse">
7
-                    <?php if ( count($data['regional']) > 0 ) { ?>
7
+                    <?php if (count($data['regional']) > 0) { ?>
8 8
                         <ul class="homepage-rep-list">
9 9
                             <li>Your Assembly Memberss: </li>
10
-                        <?php foreach ( $data['regional'] as $member ) { ?>
10
+                        <?php foreach ($data['regional'] as $member) { ?>
11 11
                             <li class="homepage-rep-list__rep"><a href="/london-assembly-member/?p=<?= $member['person_id'] ?>"><?= $member['name'] ?></a></li>
12 12
                         <?php } ?>
13 13
                         </ul>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             <div class="panel panel--flushtop clearfix">
41 41
                 <div class="row nested-row">
42 42
                     <div class="homepage-in-the-news homepage-content-section">
43
-                        <?php if ( $featured ) {
43
+                        <?php if ($featured) {
44 44
                              include dirname(__FILE__) . "/../homepage/featured.php";
45 45
                         } ?>
46 46
                     </div>
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                     <div class="homepage-recently homepage-content-section">
86 86
                         <h2>Recently answered questions to the Mayor of London</h2>
87 87
                         <ul class="recently__list"><?php
88
-                            foreach ( $debates['recent'] as $recent ) {
88
+                            foreach ($debates['recent'] as $recent) {
89 89
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
90 90
                             }
91 91
                         ?></ul>
Please login to merge, or discard this patch.
classes/Renderer/Footer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
     public $data;
16 16
 
17
-    private $about_links = array ('help', 'about', 'linktous', 'houserules', 'blog', 'news', 'contact', 'privacy');
17
+    private $about_links = array('help', 'about', 'linktous', 'houserules', 'blog', 'news', 'contact', 'privacy');
18 18
     private $assemblies_links = array('hansard', 'sp_home', 'ni_home', 'wales_home', 'london_home');
19 19
     private $international_links = array('newzealand', 'australia', 'ireland', 'mzalendo');
20 20
     private $tech_links = array('code', 'api', 'data', 'pombola', 'devmailinglist', 'irc');
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
     public function __construct() {
29 29
         $this->data = array();
30 30
 
31
-        $this->data['about'] = $this->get_menu_links( $this->about_links );
32
-        $this->data['assemblies'] = $this->get_menu_links( $this->assemblies_links );
33
-        $this->data['international'] = $this->get_menu_links( $this->international_links );
34
-        $this->data['tech'] = $this->get_menu_links( $this->tech_links );
31
+        $this->data['about'] = $this->get_menu_links($this->about_links);
32
+        $this->data['assemblies'] = $this->get_menu_links($this->assemblies_links);
33
+        $this->data['international'] = $this->get_menu_links($this->international_links);
34
+        $this->data['tech'] = $this->get_menu_links($this->tech_links);
35 35
     }
36 36
 
37 37
     /**
Please login to merge, or discard this patch.
classes/SectionView/LondonView.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     protected function getSearchSections() {
34 34
         return array(
35
-            array( 'section' => 'london' )
35
+            array('section' => 'london')
36 36
         );
37 37
     }
38 38
 
@@ -51,23 +51,23 @@  discard block
 block discarded – undo
51 51
 
52 52
         $debates = $DEBATELIST->display('recent_debates', array('days' => 30, 'num' => 9), 'none');
53 53
         $MOREURL = new \MySociety\TheyWorkForYou\Url('londondebatesfront');
54
-        $MOREURL->insert( array( 'more' => 1 ) );
54
+        $MOREURL->insert(array('more' => 1));
55 55
 
56 56
         // this makes sure that we don't repeat this debate in the list below
57 57
         $random_debate = NULL;
58
-        if ( isset($debates['data']) && count($debates['data']) ) {
58
+        if (isset($debates['data']) && count($debates['data'])) {
59 59
             $random_debate = $debates['data'][0];
60 60
         }
61 61
 
62 62
         $recent = array();
63
-        if ( isset($debates['data']) && count($debates['data']) ) {
63
+        if (isset($debates['data']) && count($debates['data'])) {
64 64
             // at the start of a session there may be less than 6
65 65
             // debates
66 66
             $max = 6;
67
-            if ( count($debates['data']) < 6 ) {
67
+            if (count($debates['data']) < 6) {
68 68
                 $max = count($debates['data']);
69 69
             }
70
-            for ( $i = 1; $i < $max; $i++ ) {
70
+            for ($i = 1; $i < $max; $i++) {
71 71
                 $debate = $debates['data'][$i];
72 72
                 $debate['desc'] = "questions to the Mayor of London";
73 73
                 $debate['more_url'] = $MOREURL->generate();
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         }
77 77
 
78 78
         $featured = array();
79
-        if ( $random_debate ) {
79
+        if ($random_debate) {
80 80
             $featured = $random_debate;
81 81
             $featured['more_url'] = $MOREURL->generate();
82 82
             $featured['desc'] = 'question to the Mayor of London';
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         $data['featured'] = $featured;
88
-        $data['debates'] = array( 'recent' => $recent);
88
+        $data['debates'] = array('recent' => $recent);
89 89
 
90 90
         $data['regional'] = $this->getAssemblyMemberList();
91 91
         $data['template'] = 'london/index';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         $data = array();
44 44
 
45
-        $data['popular_searches'] = NULL;
45
+        $data['popular_searches'] = null;
46 46
 
47 47
 
48 48
         $data['urls'] = $this->getURLs($data);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $MOREURL->insert( array( 'more' => 1 ) );
55 55
 
56 56
         // this makes sure that we don't repeat this debate in the list below
57
-        $random_debate = NULL;
57
+        $random_debate = null;
58 58
         if ( isset($debates['data']) && count($debates['data']) ) {
59 59
             $random_debate = $debates['data'][0];
60 60
         }
Please login to merge, or discard this patch.