Passed
Push — master ( a38590...890bf3 )
by Matthew
04:30
created
www/includes/easyparliament/templates/html/mp/_featured_content.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 
2 2
 <?php $featured_item = $announcement_manager->get_random_valid_item("sidebar"); ?>
3 3
 
4
-<?php if ( $featured_item ) { ?>
4
+<?php if ($featured_item) { ?>
5 5
 
6 6
 <div class="sidebar__unit__featured_side">
7 7
   <div class="featured_side__mysociety">
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/mp/_donation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 <?php $featured_item = $announcement_manager->get_random_valid_item("donation"); ?>
4 4
 
5
-<?php if ( $featured_item ) { ?>
5
+<?php if ($featured_item) { ?>
6 6
 
7 7
 <div class="sidebar__unit__featured_side">
8 8
   <div class="featured_side__content">
Please login to merge, or discard this patch.
classes/Model/AnnouncementManagement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         }
177 177
 
178 178
         # discard any invalid banners
179
-        $banners = array_filter($banners, function ($banner) {
179
+        $banners = array_filter($banners, function($banner) {
180 180
             return is_valid_item($banner);
181 181
         });
182 182
 
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
         }
199 199
 
200 200
         # discard any invalid announcements
201
-        $items = array_filter($items, function ($item) {
201
+        $items = array_filter($items, function($item) {
202 202
             return is_valid_item($item);
203 203
         });
204 204
 
205 205
         # limit to announcements with the correct location
206
-        $items = array_filter($items, function ($item) use ($location) {
206
+        $items = array_filter($items, function($item) use ($location) {
207 207
             return in_array($location, $item->location);
208 208
         });
209 209
 
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', 'news', 'privacy');
17
+    private $about_links = array('help', 'about', 'linktous', 'news', 'privacy');
18 18
     private $assemblies_links = array('hansard', 'sp_home', 'wales_home', 'ni_home', 'london_home');
19 19
     private $international_links = array('australia', 'ireland', 'mzalendo');
20 20
     private $tech_links = array('code', 'api', 'data', 'devmailinglist', 'contact');
@@ -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.
www/includes/easyparliament/templates/html/homepage/featured-content.php 1 patch
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 global $featured_debate_shown; ?>
2 2
 <?php $featured_item = $announcement_manager->get_random_valid_item("homepage"); ?>
3 3
 
4
-<?php if ( $featured_item ) { ?>
4
+<?php if ($featured_item) { ?>
5 5
 <h2>The latest</h2>
6 6
 <div class="featured-content__wrapper">
7 7
 <?php if (isset($featured_item->thumbnail_image_url)) { ?>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 <?php } else { ?>
20 20
     <?php $featured_debate_shown = true; ?>
21
-    <?php if ( count($featured) > 0 ) {
21
+    <?php if (count($featured) > 0) {
22 22
                         include 'featured.php';
23 23
                     } else { ?>
24 24
                         No debates found.
Please login to merge, or discard this patch.
www/includes/easyparliament/page.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public $within_stripe_sidebar = false;
20 20
 
21 21
     public function page_start() {
22
-        if ( !$this->page_started() ) {
22
+        if (!$this->page_started()) {
23 23
             $this->checkForAdmin();
24 24
             $this->displayHeader();
25 25
         }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $data = $h->data;
34 34
         $data = array_merge($u->data, $data);
35
-        if ( isset($page_errors) ) {
35
+        if (isset($page_errors)) {
36 36
             $data['page_errors'] = $page_errors;
37 37
         }
38 38
         $data['banner_text'] = '';
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 $THISPAGE = new \MySociety\TheyWorkForYou\Url($this_page);
53 53
 
54 54
                 $LOGINURL = new \MySociety\TheyWorkForYou\Url('userlogin');
55
-                $LOGINURL->insert(array('ret' => $THISPAGE->generate('none') ));
55
+                $LOGINURL->insert(array('ret' => $THISPAGE->generate('none')));
56 56
 
57 57
                 $text = "<a href=\"" . $LOGINURL->generate() . '">' . gettext('You’d better sign in!') . '</a>';
58 58
             } else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     public function page_end() {
70
-        if ( !$this->page_started() ) {
70
+        if (!$this->page_started()) {
71 71
             $this->page_start();
72 72
         }
73 73
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         }
102 102
     }
103 103
 
104
-    public function stripe_start($type='side', $id='', $extra_class = '') {
104
+    public function stripe_start($type = 'side', $id = '', $extra_class = '') {
105 105
         // $type is one of:
106 106
         //  'full' - a full width div
107 107
         //  'side' - a white stripe with a coloured sidebar.
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
 
137
-    public function stripe_end ($contents = array(), $extra = '') {
137
+    public function stripe_end($contents = array(), $extra = '') {
138 138
         // $contents is an array containing 0 or more hashes.
139 139
         // Each hash has two values, 'type' and 'content'.
140 140
         // 'Type' could be one of these:
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     public function include_sidebar_template($sidebarname) {
238 238
         global $this_page, $DATA;
239 239
 
240
-            $sidebarpath = INCLUDESPATH.'easyparliament/sidebars/'.$sidebarname.'.php';
240
+            $sidebarpath = INCLUDESPATH . 'easyparliament/sidebars/' . $sidebarname . '.php';
241 241
 
242 242
             if (file_exists($sidebarpath)) {
243 243
                 include $sidebarpath;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     }
246 246
 
247 247
 
248
-    public function block_start($data=array()) {
248
+    public function block_start($data = array()) {
249 249
         // Starts a 'block' div, used mostly on the home page,
250 250
         // on the MP page, and in the sidebars.
251 251
         // $data is a hash like this:
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         if (is_string($message)) {
393 393
             // Sometimes we're just sending a single line to this function
394 394
             // rather like the bigger array...
395
-            $message = array (
395
+            $message = array(
396 396
                 'text' => $message
397 397
             );
398 398
         }
@@ -400,13 +400,13 @@  discard block
 block discarded – undo
400 400
         // if the page has started then we're most likely in an old school page
401 401
         // so we should just print out the error, otherwise stick it in the error
402 402
         // global which will then be displayed by the header template
403
-        if ( $this->page_started() ) {
403
+        if ($this->page_started()) {
404 404
             $this->message($message, 'error');
405 405
         } else {
406
-            if ( !isset($page_errors) ) {
406
+            if (!isset($page_errors)) {
407 407
                 $page_errors = array();
408 408
             }
409
-            $page_errors[]  = $message;
409
+            $page_errors[] = $message;
410 410
         }
411 411
 
412 412
         if ($fatal) {
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
     }
424 424
 
425 425
 
426
-    public function message($message, $class='') {
426
+    public function message($message, $class = '') {
427 427
         // Generates a very simple but common page content.
428 428
         // Used for when a user logs out, or votes, or any simple thing
429 429
         // where there's a little message and probably a link elsewhere.
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
             if ($page_title != '') {
514 514
                 $page_title .= ': ';
515 515
             }
516
-            $page_title .= format_date ($info['date'], SHORTDATEFORMAT);
516
+            $page_title .= format_date($info['date'], SHORTDATEFORMAT);
517 517
         }
518 518
 
519 519
         if ($page_title != '') {
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 
569 569
         if (isset($nextprev['up'])) {
570 570
 
571
-            $uplink = '<span class="up"><a href="' .  $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>';
571
+            $uplink = '<span class="up"><a href="' . $nextprev['up']['url'] . '" title="' . $nextprev['up']['title'] . '">' . $nextprev['up']['body'] . '</a>';
572 572
             if (get_http_var('s')) {
573 573
                 $URL = new \MySociety\TheyWorkForYou\Url($this_page);
574 574
                 $uplink .= '<br><a href="' . $URL->generate() . '">' . gettext('Remove highlighting') . '</a>';
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
             $next = $nextprev['next'];
584 584
 
585 585
             if (isset($next['url'])) {
586
-                $nextlink = '<a href="' .  $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' &raquo;</a>';
586
+                $nextlink = '<a href="' . $next['url'] . '" title="' . $next['title'] . '" class="linkbutton">' . $next['body'] . ' &raquo;</a>';
587 587
             } else {
588 588
                 $nextlink = $next['body'] . ' &raquo;';
589 589
             }
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
     }
601 601
 
602 602
 
603
-    public function search_form($value='') {
603
+    public function search_form($value = '') {
604 604
         global $SEARCHENGINE;
605 605
         // Search box on the search page.
606 606
         // If $value is set then it will be displayed in the form.
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
             }
631 631
 
632 632
         echo '<div class="mainsearchbox">';
633
-        if ($wtt<2) {
633
+        if ($wtt < 2) {
634 634
                 echo '<form action="', $URL->generate(), '" method="get">';
635 635
                 if (get_http_var('o')) {
636 636
                     echo '<input type="hidden" name="o" value="', _htmlentities(get_http_var('o')), '">';
@@ -663,16 +663,16 @@  discard block
 block discarded – undo
663 663
                     $ordering = 'd';
664 664
                 }
665 665
 
666
-                if ($ordering=='r') {
666
+                if ($ordering == 'r') {
667 667
                 print '<strong>' . gettext('Sorted by relevance') . '</strong>';
668 668
                 } else {
669 669
                 printf(gettext("<a href='%s'>Sort by relevance</a>"), $orderUrl->generate('html', array('o'=>'r')));
670 670
                 }
671 671
 
672 672
                 print "&nbsp;|&nbsp;";
673
-                if ($ordering=='d') {
673
+                if ($ordering == 'd') {
674 674
                 print '<strong>' . gettext('Sorted by date:') . ' ' . gettext('newest') . '</strong> / <a href="' . $orderUrl->generate('html', array('o'=>'o')) . '">' . gettext('oldest') . '</a>';
675
-                } elseif ($ordering=='o') {
675
+                } elseif ($ordering == 'o') {
676 676
                 print '<strong>' . gettext('Sorted by date:') . '</strong> <a href="' . $orderUrl->generate('html', array('o'=>'d')) . '">' . gettext('newest') . '</a> / <strong>' . gettext('oldest') . '</strong>';
677 677
                 } else {
678 678
                 print gettext("Sort by date:") . ' ';
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
                 }
686 686
 
687 687
             print "&nbsp;|&nbsp;";
688
-            if ($ordering=='p') {
688
+            if ($ordering == 'p') {
689 689
                 print '<strong>' . gettext('Use by person') . '</strong>';
690 690
             } else {
691 691
                 printf('<a href="%s">', $orderUrl->generate('html', array('o'=>'p')));
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
         echo '</form> </div>';
707 707
     }
708 708
 
709
-    public function login_form ($errors = array()) {
709
+    public function login_form($errors = array()) {
710 710
         // Used for /user/login/ and /user/prompt/
711 711
         // $errors is a hash of potential errors from a previous log in attempt.
712 712
         ?>
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
     public function glossary_atoz(&$GLOSSARY) {
810 810
     // Print out a nice list of lettered links to glossary pages
811 811
 
812
-        $letters = array ();
812
+        $letters = array();
813 813
 
814 814
         foreach ($GLOSSARY->alphabet as $letter => $eps) {
815 815
             // if we're writing out the current letter (list or item)
@@ -840,14 +840,14 @@  discard block
 block discarded – undo
840 840
                     <div class="letters">
841 841
                         <ul>
842 842
     <?php
843
-        for ($n=0; $n<13; $n++) {
843
+        for ($n = 0; $n < 13; $n++) {
844 844
             print $letters[$n];
845 845
         }
846 846
         ?>
847 847
                         </ul>
848 848
                         <ul>
849 849
     <?php
850
-        for ($n=13; $n<26; $n++) {
850
+        for ($n = 13; $n < 26; $n++) {
851 851
             print $letters[$n];
852 852
         }
853 853
         ?>
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
 
867 867
         // add some extra controls for the administrators
868 868
         if ($this_page == "admin_glossary") {
869
-            print "<a id=\"gl".$term['glossary_id']."\"></a>";
869
+            print "<a id=\"gl" . $term['glossary_id'] . "\"></a>";
870 870
             print "<h3>" . $term['title'] . "</h3>";
871 871
             $URL = new \MySociety\TheyWorkForYou\Url('admin_glossary');
872 872
             $URL->insert(array("delete_confirm" => $term['glossary_id']));
873 873
             $delete_url = $URL->generate();
874
-            $admin_links = "<br><small><a href=\"".$delete_url."\">delete</a></small>";
874
+            $admin_links = "<br><small><a href=\"" . $delete_url . "\">delete</a></small>";
875 875
         } else {
876 876
             $admin_links = "";
877 877
         }
@@ -892,9 +892,9 @@  discard block
 block discarded – undo
892 892
             // Add a direct search link for current glossary item
893 893
             $URL = new \MySociety\TheyWorkForYou\Url('search');
894 894
             // remember to quote the term for phrase matching in search
895
-            $URL->insert(array('s' => '"'.$term['title'].'"'));
895
+            $URL->insert(array('s' => '"' . $term['title'] . '"'));
896 896
             $search_url = $URL->generate();
897
-            printf ("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']);
897
+            printf("\t\t\t\t<p>Search hansard for \"<a href=\"%s\" title=\"View search results for this glossary item\">%s</a>\"</p>", $search_url, $term['title']);
898 898
         }
899 899
     }
900 900
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 
970 970
             // Generate all the page links.
971 971
             $URL = new \MySociety\TheyWorkForYou\Url($this_page);
972
-            $URL->insert( array('wtt' => get_http_var('wtt')) );
972
+            $URL->insert(array('wtt' => get_http_var('wtt')));
973 973
             if (isset($pagedata['s'])) {
974 974
                 # XXX: Should be taken out in *one* place, not here + search_form etc.
975 975
                 $value = $pagedata['s'];
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
                 $body = trim_characters($report['body'], 0, 40);
1109 1109
 
1110
-                $tabledata['rows'][] = array (
1110
+                $tabledata['rows'][] = array(
1111 1111
                     _htmlentities($report['firstname'] . ' ' . $report['lastname']),
1112 1112
                     _htmlentities($body),
1113 1113
                     $report['reported'],
@@ -1189,11 +1189,11 @@  discard block
 block discarded – undo
1189 1189
         // Returns HTML suitable for putting in the sidebar on Admin pages.
1190 1190
         global $this_page, $DATA;
1191 1191
 
1192
-        $pages = array ('admin_home',
1192
+        $pages = array('admin_home',
1193 1193
                 'admin_comments', 'admin_searchlogs', 'admin_popularsearches', 'admin_failedsearches',
1194 1194
                 'alert_stats', 'admin_statistics', 'admin_reportstats',
1195 1195
                 'admin_commentreports', 'admin_glossary', 'admin_glossary_pending', 'admin_badusers',
1196
-                'admin_profile_message', 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_announcement' ,'admin_featured', 'admin_topics',
1196
+                'admin_profile_message', 'admin_photos', 'admin_mpurls', 'admin_policies', 'admin_banner', 'admin_announcement', 'admin_featured', 'admin_topics',
1197 1197
                 'admin_wikipedia',
1198 1198
                 );
1199 1199
 
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/ni/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 <div class="row nested-row">
59 59
                     <div class="homepage-featured-content homepage-content-section">
60 60
                         <?php if ( $featured ) {
61
-                             include dirname(__FILE__) . "/../homepage/featured.php";
61
+                                include dirname(__FILE__) . "/../homepage/featured.php";
62 62
                         } ?>
63 63
                     </div>
64 64
                     <div class="homepage-create-alert homepage-content-section">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             <div class="panel panel--flushtop clearfix">
18 18
                 <div class="row nested-row">
19 19
                     <div class="homepage-featured-content homepage-content-section">
20
-                        <?php if ( $featured ) {
20
+                        <?php if ($featured) {
21 21
                              include dirname(__FILE__) . "/../homepage/featured.php";
22 22
                         } ?>
23 23
                     </div>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                     <div class="homepage-recently homepage-content-section">
35 35
                         <h2>Recently in the Northern Ireland Assembly</h2>
36 36
                         <ul class="recently__list"><?php
37
-                            foreach ( $debates['recent'] as $recent ) {
37
+                            foreach ($debates['recent'] as $recent) {
38 38
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
39 39
                             }
40 40
                         ?></ul>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/senedd/index.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
                 <div class="row nested-row">
59 59
                     <div class="homepage-featured-content homepage-content-section">
60 60
                         <?php if ( $featured ) {
61
-                             include dirname(__FILE__) . "/../homepage/featured.php";
61
+                                include dirname(__FILE__) . "/../homepage/featured.php";
62 62
                         } ?>
63 63
                     </div>
64 64
                     <div class="homepage-create-alert homepage-content-section">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             <div class="panel panel--flushtop clearfix">
18 18
                 <div class="row nested-row">
19 19
                     <div class="homepage-featured-content homepage-content-section">
20
-                        <?php if ( $featured ) {
20
+                        <?php if ($featured) {
21 21
                              include dirname(__FILE__) . "/../homepage/featured.php";
22 22
                         } ?>
23 23
                     </div>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                     <div class="homepage-recently homepage-content-section">
35 35
                         <h2><?= gettext('Recently in the Senedd') ?></h2>
36 36
                         <ul class="recently__list"><?php
37
-                            foreach ( $debates['recent'] as $recent ) {
37
+                            foreach ($debates['recent'] as $recent) {
38 38
                                 include dirname(__FILE__) . '/../homepage/recent-debates.php';
39 39
                             }
40 40
                         ?></ul>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/section/_business_section.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
     <div class="business-section">
2 2
         <div class="business-section__header">
3 3
             <h1 class="business-section__header__title">
4
-            <?php if ($title == "Dadleuon y Senedd"){ ?>
4
+            <?php if ($title == "Dadleuon y Senedd") { ?>
5 5
             Dadleuon diweddar Y Senedd
6 6
             <?php } else { ?>
7 7
             <?= sprintf(gettext('Recent %s'), $title) ?>
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
         </div>
11 11
 
12 12
         <?php
13
-            if ( isset($content['data']['data']) ) {
13
+            if (isset($content['data']['data'])) {
14 14
                 $data = $content['data']['data'];
15 15
                 include '_business_list.php'; ?>
16 16
                 <div class="business-section__secondary">
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
                         include '_calendar_section.php';
25 25
                         ?>
26 26
                     </div>
27
-                  <?php if ( isset($content['rssurl']) ) { ?>
27
+                  <?php if (isset($content['rssurl'])) { ?>
28 28
                     <div class="business-section__secondary__item">
29 29
                         <p class="rss-feed">
30 30
                             <a href="<?= WEBPATH . $content['rssurl'] ?>"><?= sprintf(gettext('RSS feed of %s'), $title) ?></a>
Please login to merge, or discard this patch.