@@ -102,10 +102,11 @@ discard block |
||
102 | 102 | Loader::load('view', '/Head', $this->data_array['head']); |
103 | 103 | foreach($this->body_view_array as $view) |
104 | 104 | { |
105 | - if(substr($view, 0, 1) == '/') |
|
106 | - Loader::load('view', $view, $this->data_array['body']); |
|
107 | - else |
|
108 | - Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
105 | + if(substr($view, 0, 1) == '/') { |
|
106 | + Loader::load('view', $view, $this->data_array['body']); |
|
107 | + } else { |
|
108 | + Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
109 | + } |
|
109 | 110 | } |
110 | 111 | |
111 | 112 | if (URLDecode::getSite() == 'waterfalls') { |
@@ -114,8 +115,9 @@ discard block |
||
114 | 115 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
115 | 116 | } |
116 | 117 | |
117 | - if($view == '/404' || $view == '/503') |
|
118 | - exit; |
|
118 | + if($view == '/404' || $view == '/503') { |
|
119 | + exit; |
|
120 | + } |
|
119 | 121 | } |
120 | 122 | |
121 | 123 | protected function set_header_method($method) |
@@ -195,14 +197,16 @@ discard block |
||
195 | 197 | |
196 | 198 | protected function eject() |
197 | 199 | { |
198 | - if(get_class($this) !== 'Error404Controller') |
|
199 | - Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
200 | + if(get_class($this) !== 'Error404Controller') { |
|
201 | + Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
202 | + } |
|
200 | 203 | } |
201 | 204 | |
202 | 205 | protected function unavailable() |
203 | 206 | { |
204 | - if(get_class($this) !== 'Error503Controller') |
|
205 | - Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
207 | + if(get_class($this) !== 'Error503Controller') { |
|
208 | + Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
209 | + } |
|
206 | 210 | } |
207 | 211 | |
208 | 212 | protected function redirect($uri, $method = 301) |
@@ -210,12 +214,14 @@ discard block |
||
210 | 214 | switch($method) |
211 | 215 | { |
212 | 216 | case 301 : |
213 | - if(get_class($this) !== 'Error301Controller') |
|
214 | - Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
217 | + if(get_class($this) !== 'Error301Controller') { |
|
218 | + Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
219 | + } |
|
215 | 220 | break; |
216 | 221 | case 303 : |
217 | - if(get_class($this) !== 'Error303Controller') |
|
218 | - Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
222 | + if(get_class($this) !== 'Error303Controller') { |
|
223 | + Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
224 | + } |
|
219 | 225 | break; |
220 | 226 | } |
221 | 227 | } |
@@ -262,18 +268,19 @@ discard block |
||
262 | 268 | $comment_object->url = $comment->url; |
263 | 269 | $comment_object->trusted = $comment->trusted; |
264 | 270 | |
265 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
266 | - $comment_object->errors = $this->comment_errors; |
|
267 | - else |
|
268 | - $comment_object->errors = array(); |
|
271 | + if($comment->reply == 0 && Request::getPost('type') == $comment->id) { |
|
272 | + $comment_object->errors = $this->comment_errors; |
|
273 | + } else { |
|
274 | + $comment_object->errors = array(); |
|
275 | + } |
|
269 | 276 | |
270 | 277 | if($comment->reply == 0) |
271 | 278 | { |
272 | 279 | $comment_object->replies = array(); |
273 | 280 | $comment_array[$comment->id] = $comment_object; |
274 | - } |
|
275 | - else |
|
276 | - $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
281 | + } else { |
|
282 | + $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
283 | + } |
|
277 | 284 | } |
278 | 285 | |
279 | 286 | $comment_count = CommentCollector::getCommentCountForURL($site, $path); |
@@ -298,22 +305,26 @@ discard block |
||
298 | 305 | $commenter->website = ''; |
299 | 306 | |
300 | 307 | $commenter_cookie = Cookie::instance('Commenter'); |
301 | - if(!$commenter_cookie->exists()) |
|
302 | - return $commenter; |
|
308 | + if(!$commenter_cookie->exists()) { |
|
309 | + return $commenter; |
|
310 | + } |
|
303 | 311 | |
304 | 312 | $commenter_cookie_value = $commenter_cookie->getValue(); |
305 | 313 | $commenter_cookie_value = json_decode($commenter_cookie_value); |
306 | 314 | |
307 | - if($commenter_cookie_value === NULL) |
|
308 | - return $commenter; |
|
315 | + if($commenter_cookie_value === NULL) { |
|
316 | + return $commenter; |
|
317 | + } |
|
309 | 318 | |
310 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
311 | - return $commenter; |
|
319 | + if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) { |
|
320 | + return $commenter; |
|
321 | + } |
|
312 | 322 | |
313 | 323 | $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
314 | 324 | |
315 | - if($commenter_object === NULL) |
|
316 | - return $commenter; |
|
325 | + if($commenter_object === NULL) { |
|
326 | + return $commenter; |
|
327 | + } |
|
317 | 328 | |
318 | 329 | $commenter->id = $commenter_object->id; |
319 | 330 | $commenter->name = $commenter_object->name; |
@@ -17,8 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | public static function instance() |
19 | 19 | { |
20 | - if(!isset(self::$instance)) |
|
21 | - self::$instance = new Loader(); |
|
20 | + if(!isset(self::$instance)) { |
|
21 | + self::$instance = new Loader(); |
|
22 | + } |
|
22 | 23 | return self::$instance; |
23 | 24 | } |
24 | 25 | |
@@ -107,8 +108,9 @@ discard block |
||
107 | 108 | foreach((array) $files as $file) |
108 | 109 | { |
109 | 110 | $file_path = self::instance()->get_path($type, $file); |
110 | - if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view') |
|
111 | - continue; |
|
111 | + if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view') { |
|
112 | + continue; |
|
113 | + } |
|
112 | 114 | |
113 | 115 | // if(!file_exists($file_path)) |
114 | 116 | // Debugger::logMessage("Requested file does not exist: {$type}, {$file}"); |
@@ -160,10 +162,11 @@ discard block |
||
160 | 162 | |
161 | 163 | $reflectionObject = self::create_reflection_class($file); |
162 | 164 | |
163 | - if($reflectionObject->hasMethod('__construct')) |
|
164 | - return $reflectionObject->newInstanceArgs($data); |
|
165 | - else |
|
166 | - return $reflectionObject->newInstance(); |
|
165 | + if($reflectionObject->hasMethod('__construct')) { |
|
166 | + return $reflectionObject->newInstanceArgs($data); |
|
167 | + } else { |
|
168 | + return $reflectionObject->newInstance(); |
|
169 | + } |
|
167 | 170 | } |
168 | 171 | |
169 | 172 | public static function getRoot() |