Failed Conditions
Pull Request — master (#1327)
by Nick
04:55
created
classes/SectionView/PbcView.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
         if ($bill_id && $id) {
44 44
             return $this->display_section_or_speech(array(
45
-                'gid' => $standingprefix . $id,
45
+                'gid' => $standingprefix.$id,
46 46
             ));
47 47
         } elseif ($bill_id) {
48 48
             # Display the page for a particular bill
49 49
             $this_page = 'pbc_bill';
50
-            $args = array (
50
+            $args = array(
51 51
                 'id' => $bill_id,
52 52
                 'title' => $this->bill,
53 53
                 'session' => $this->session,
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
         } elseif ($this->session && $this->bill) {
61 61
             # Illegal bill title, redirect to session page
62 62
             $URL = new \MySociety\TheyWorkForYou\Url('pbc_session');
63
-            header('Location: ' . $URL->generate() . urlencode($this->session));
63
+            header('Location: '.$URL->generate().urlencode($this->session));
64 64
             exit;
65 65
         } elseif ($this->session) {
66 66
             # Display the bills for a particular session
67 67
             $this_page = 'pbc_session';
68 68
             $DATA->set_page_metadata($this_page, 'title', "Session $this->session");
69
-            $args = array (
69
+            $args = array(
70 70
                 'session' => $this->session,
71 71
             );
72 72
             $data = array();
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
 
89 89
     protected function getSearchSections() {
90 90
         return array(
91
-            array( 'section' => 'pbc' )
91
+            array('section' => 'pbc')
92 92
         );
93 93
     }
94 94
 
95 95
     protected function front_content() {
96
-        return $this->list->display( 'recent_pbc_debates', array( 'num' => 50 ), 'none' );
96
+        return $this->list->display('recent_pbc_debates', array('num' => 50), 'none');
97 97
     }
98 98
 
99 99
     protected function display_front() {
Please login to merge, or discard this patch.
classes/SectionView/NiView.php 1 patch
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' => 'ni' )
35
+            array('section' => 'ni')
36 36
         );
37 37
     }
38 38
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 
53 53
         $debates = $DEBATELIST->display('recent_debates', array('days' => 30, 'num' => 6), 'none');
54 54
         $MOREURL = new \MySociety\TheyWorkForYou\Url('nidebatesfront');
55
-        $MOREURL->insert( array( 'more' => 1 ) );
55
+        $MOREURL->insert(array('more' => 1));
56 56
 
57 57
         // this makes sure that we don't repeat this debate in the list below
58 58
         $random_debate = NULL;
59
-        if ( isset($debates['data']) && count($debates['data']) ) {
59
+        if (isset($debates['data']) && count($debates['data'])) {
60 60
             $random_debate = $debates['data'][0];
61 61
         }
62 62
 
63 63
         $recent = array();
64
-        if ( isset($debates['data']) && count($debates['data']) ) {
64
+        if (isset($debates['data']) && count($debates['data'])) {
65 65
             // at the start of a session there may be less than 6
66 66
             // debates
67 67
             $max = 6;
68
-            if ( count($debates['data']) < 6 ) {
68
+            if (count($debates['data']) < 6) {
69 69
                 $max = count($debates['data']);
70 70
             }
71
-            for ( $i = 1; $i < $max; $i++ ) {
71
+            for ($i = 1; $i < $max; $i++) {
72 72
                 $debate = $debates['data'][$i];
73 73
                 $debate['desc'] = "Northern Ireland Assembly debates";
74 74
                 $debate['more_url'] = $MOREURL->generate();
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         }
78 78
 
79 79
         $featured = array();
80
-        if ( $random_debate ) {
80
+        if ($random_debate) {
81 81
             $featured = $random_debate;
82 82
             $featured['more_url'] = $MOREURL->generate();
83 83
             $featured['desc'] = 'Northern Ireland Assembly debate';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
 
88 88
         $data['featured'] = $featured;
89
-        $data['debates'] = array( 'recent' => $recent);
89
+        $data['debates'] = array('recent' => $recent);
90 90
 
91 91
         $data['regional'] = $this->getMLAList();
92 92
         $data['template'] = 'ni/index';
Please login to merge, or discard this patch.
classes/Url.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
     /**
115 115
      * Remove Session Key/Value Pair
116 116
      *
117
-     * @param array $arr A list array of key names to remove
117
+     * @param string[] $arr A list array of key names to remove
118 118
      */
119 119
 
120 120
     public function remove($arr) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         // These stores an associative array of key/value pairs that
44 44
         // we'll want passed on to other pages.
45
-        $this->session_vars = array ();
45
+        $this->session_vars = array();
46 46
 
47 47
         // Prevent things using $DATA running if it hasn't been set, ie in testing
48 48
         if (isset($DATA)) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     public function reset() {
95 95
         // Call this to remove all the session_vars.
96
-        $this->session_vars = array ();
96
+        $this->session_vars = array();
97 97
     }
98 98
 
99 99
     /**
@@ -162,30 +162,30 @@  discard block
 block discarded – undo
162 162
      *                            override just one or two of them.
163 163
      */
164 164
 
165
-    public function generate($encode = "html", $overrideVars=array()) {
165
+    public function generate($encode = "html", $overrideVars = array()) {
166 166
 
167 167
         global $DATA;
168 168
 
169
-        $url_args = array ();
169
+        $url_args = array();
170 170
 
171 171
         foreach (array_merge($this->session_vars, $overrideVars) as $key => $var) {
172 172
             if (is_array($var)) {
173 173
                 foreach ($var as $v) {
174
-                    $url_args[] = "$key=" . urlencode(stripslashes($v));
174
+                    $url_args[] = "$key=".urlencode(stripslashes($v));
175 175
                 }
176 176
             } elseif ($var != null)
177
-                $url_args[] = "$key=" . urlencode(stripslashes($var));
177
+                $url_args[] = "$key=".urlencode(stripslashes($var));
178 178
         }
179 179
 
180
-        $page_url = WEBPATH . $DATA->page_metadata($this->destinationpage, "url");
180
+        $page_url = WEBPATH.$DATA->page_metadata($this->destinationpage, "url");
181 181
 
182 182
         if (sizeof($url_args) == 0) {
183 183
             return $page_url;
184 184
         } else {
185 185
             if ($encode == "html") {
186
-                return $page_url . "?" . implode("&amp;", $url_args);
186
+                return $page_url."?".implode("&amp;", $url_args);
187 187
             } elseif ($encode == "none" || $encode == "url") {
188
-                return $page_url . "?" . implode("&", $url_args);
188
+                return $page_url."?".implode("&", $url_args);
189 189
             }
190 190
         }
191 191
     }
Please login to merge, or discard this patch.