@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | protected $connections; |
12 | 12 | |
13 | 13 | /** |
14 | - * @param ConnectonLocator $connections |
|
14 | + * @param ConnectionLocator $connections |
|
15 | 15 | */ |
16 | 16 | public function __construct(ConnectionLocator $connections) |
17 | 17 | { |
@@ -41,7 +41,6 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | - * @param string $title |
|
45 | 44 | * |
46 | 45 | * @return array|false |
47 | 46 | */ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'date' => date('Y'))); |
41 | 41 | |
42 | 42 | Loader::loadInstance('utility', 'Database'); |
43 | - if(Database::isConnected() === false) |
|
43 | + if (Database::isConnected() === false) |
|
44 | 44 | $this->unavailable(); |
45 | 45 | } |
46 | 46 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $post_result = $activityRepository->getPosts(5); |
66 | 66 | |
67 | 67 | $post_array = array(); |
68 | - foreach($post_result as $row) |
|
68 | + foreach ($post_result as $row) |
|
69 | 69 | { |
70 | - $post_array[] = $this->expand_post($row);; |
|
70 | + $post_array[] = $this->expand_post($row); ; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $post_array; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $post = new stdclass(); |
89 | 89 | |
90 | - switch($raw_post['type']) |
|
90 | + switch ($raw_post['type']) |
|
91 | 91 | { |
92 | 92 | case 'blog' : |
93 | 93 | $row = $blogRepository->getBlogById($raw_post['type_id']); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $post->title = "Blogged about {$category}: <a href=\"{$row['url']}\">{$row['title']}</a>."; |
99 | 99 | $post->comments = $row['comments']; |
100 | 100 | |
101 | - if($format == 'full') |
|
101 | + if ($format == 'full') |
|
102 | 102 | $post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard'); |
103 | 103 | break; |
104 | 104 | case 'book' : |
@@ -107,23 +107,23 @@ discard block |
||
107 | 107 | $post->type = 'book'; |
108 | 108 | $post->title = "Just finished reading {$row['title']} by {$row['author']}."; |
109 | 109 | |
110 | - if($format == 'full') |
|
110 | + if ($format == 'full') |
|
111 | 111 | $post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />"; |
112 | 112 | break; |
113 | 113 | case 'distance' : |
114 | 114 | $row = $distanceRepository->getDistanceById($raw_post['type_id']); |
115 | 115 | |
116 | 116 | $post->type = 'distance'; |
117 | - if($row['type'] == 'running') |
|
117 | + if ($row['type'] == 'running') |
|
118 | 118 | { |
119 | 119 | $post->title = "Ran {$row['distance']} miles and felt {$row['felt']}."; |
120 | - if(strlen($row['message']) > 0) |
|
120 | + if (strlen($row['message']) > 0) |
|
121 | 121 | $post->title .= " Afterwards, I was all like '{$row['message']}'."; |
122 | 122 | } |
123 | - else if($row['type'] == 'hiking') |
|
123 | + else if ($row['type'] == 'hiking') |
|
124 | 124 | { |
125 | 125 | $post->title = "Hiked {$row['distance']} miles and felt {$row['felt']}."; |
126 | - if(strlen($row['title']) > 0) |
|
126 | + if (strlen($row['title']) > 0) |
|
127 | 127 | $post->title .= " I was hiking up around the {$row['title']} area."; |
128 | 128 | } |
129 | 129 | else if ($row['type'] == 'walking') { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $post->type = 'twitter'; |
143 | 143 | |
144 | - if($format == 'full') |
|
144 | + if ($format == 'full') |
|
145 | 145 | $post->title = $row['text_formatted_full']; |
146 | 146 | else |
147 | 147 | $post->title = $row['text_formatted']; |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | |
155 | 155 | $post->type = 'youtube'; |
156 | 156 | |
157 | - if($format == 'full') |
|
157 | + if ($format == 'full') |
|
158 | 158 | $post->title = "Favorited {$row['title']} by {$row['author']} on YouTube."; |
159 | 159 | else |
160 | 160 | $post->title = "Favorited <a href=\"http://www.youtube.com/watch?feature=player_embedded&v={$row['video_id']}\" rel=\"nofollow\" target=\"_blank\" title=\"{$row['content']}\">{$row['title']}</a> by {$row['author']} on YouTube."; |
161 | 161 | |
162 | - if($format == 'full') |
|
162 | + if ($format == 'full') |
|
163 | 163 | $post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"; |
164 | 164 | break; |
165 | 165 | } |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | $headers = $this->headers; |
188 | 188 | Header::$headers(); |
189 | 189 | Loader::load('view', '/Head', $this->data_array['head']); |
190 | - foreach($this->body_view_array as $view) |
|
190 | + foreach ($this->body_view_array as $view) |
|
191 | 191 | { |
192 | - if(substr($view, 0, 1) == '/') |
|
192 | + if (substr($view, 0, 1) == '/') |
|
193 | 193 | Loader::load('view', $view, $this->data_array['body']); |
194 | 194 | else |
195 | 195 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
202 | 202 | } |
203 | 203 | |
204 | - if($view == '/404' || $view == '/503') |
|
204 | + if ($view == '/404' || $view == '/503') |
|
205 | 205 | exit; |
206 | 206 | } |
207 | 207 | |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | |
263 | 263 | $js_array = array(); |
264 | 264 | |
265 | - if(count($this->js_array) > 0) |
|
265 | + if (count($this->js_array) > 0) |
|
266 | 266 | $js_array = array_merge($js_array, $this->js_array); |
267 | 267 | |
268 | - if(count($js_array) > 0) |
|
268 | + if (count($js_array) > 0) |
|
269 | 269 | $js_array = Asset::getJS($js_array); |
270 | 270 | |
271 | 271 | $this->set_head('css_link_array', $css_array); |
@@ -279,26 +279,26 @@ discard block |
||
279 | 279 | |
280 | 280 | protected function eject() |
281 | 281 | { |
282 | - if(get_class($this) !== 'Error404Controller') |
|
282 | + if (get_class($this) !== 'Error404Controller') |
|
283 | 283 | Loader::loadNew('controller', '/Error404Controller')->activate(); |
284 | 284 | } |
285 | 285 | |
286 | 286 | protected function unavailable() |
287 | 287 | { |
288 | - if(get_class($this) !== 'Error503Controller') |
|
288 | + if (get_class($this) !== 'Error503Controller') |
|
289 | 289 | Loader::loadNew('controller', '/Error503Controller')->activate(); |
290 | 290 | } |
291 | 291 | |
292 | 292 | protected function redirect($uri, $method = 301) |
293 | 293 | { |
294 | - switch($method) |
|
294 | + switch ($method) |
|
295 | 295 | { |
296 | 296 | case 301 : |
297 | - if(get_class($this) !== 'Error301Controller') |
|
297 | + if (get_class($this) !== 'Error301Controller') |
|
298 | 298 | Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
299 | 299 | break; |
300 | 300 | case 303 : |
301 | - if(get_class($this) !== 'Error303Controller') |
|
301 | + if (get_class($this) !== 'Error303Controller') |
|
302 | 302 | Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
303 | 303 | break; |
304 | 304 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | private $comment_errors; |
319 | 319 | protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
320 | 320 | { |
321 | - if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
321 | + if (Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
322 | 322 | { |
323 | 323 | $parameters = array($site_id, $path, $redirect_url, $page_title); |
324 | 324 | $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate(); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $comment_array = array(); |
337 | 337 | $comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id); |
338 | 338 | |
339 | - foreach($comment_result as $comment) |
|
339 | + foreach ($comment_result as $comment) |
|
340 | 340 | { |
341 | 341 | $comment_object = new stdclass(); |
342 | 342 | $comment_object->id = $comment->id; |
@@ -346,12 +346,12 @@ discard block |
||
346 | 346 | $comment_object->url = $comment->url; |
347 | 347 | $comment_object->trusted = $comment->trusted; |
348 | 348 | |
349 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
349 | + if ($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
350 | 350 | $comment_object->errors = $this->comment_errors; |
351 | 351 | else |
352 | 352 | $comment_object->errors = array(); |
353 | 353 | |
354 | - if($comment->reply == 0) |
|
354 | + if ($comment->reply == 0) |
|
355 | 355 | { |
356 | 356 | $comment_object->replies = array(); |
357 | 357 | $comment_array[$comment->id] = $comment_object; |
@@ -382,21 +382,21 @@ discard block |
||
382 | 382 | $commenter->website = ''; |
383 | 383 | |
384 | 384 | $commenter_cookie = Cookie::instance('Commenter'); |
385 | - if(!$commenter_cookie->exists()) |
|
385 | + if (!$commenter_cookie->exists()) |
|
386 | 386 | return $commenter; |
387 | 387 | |
388 | 388 | $commenter_cookie_value = $commenter_cookie->getValue(); |
389 | 389 | $commenter_cookie_value = json_decode($commenter_cookie_value); |
390 | 390 | |
391 | - if($commenter_cookie_value === NULL) |
|
391 | + if ($commenter_cookie_value === NULL) |
|
392 | 392 | return $commenter; |
393 | 393 | |
394 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
394 | + if (!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
395 | 395 | return $commenter; |
396 | 396 | |
397 | 397 | $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
398 | 398 | |
399 | - if($commenter_object === NULL) |
|
399 | + if ($commenter_object === NULL) |
|
400 | 400 | return $commenter; |
401 | 401 | |
402 | 402 | $commenter->id = $commenter_object->id; |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | parent::__construct(); |
21 | 21 | |
22 | 22 | $id = URLDecode::getPiece(2); |
23 | - if(!$id || !is_numeric($id)) |
|
23 | + if (!$id || !is_numeric($id)) |
|
24 | 24 | $this->eject(); |
25 | 25 | |
26 | 26 | $post = $this->postRepository->getPostById($id); |
27 | - if(!$post) |
|
27 | + if (!$post) |
|
28 | 28 | $this->eject(); |
29 | 29 | |
30 | - if(URLDecode::getPiece(1) != $post['type']) |
|
30 | + if (URLDecode::getPiece(1) != $post['type']) |
|
31 | 31 | $this->eject(); |
32 | 32 | |
33 | 33 | $this->post = $post; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function get_title() |
61 | 61 | { |
62 | - switch($this->post['type']) |
|
62 | + switch ($this->post['type']) |
|
63 | 63 | { |
64 | 64 | case 'blog' : |
65 | 65 | return 'Jacob blogged'; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | private function get_description() |
86 | 86 | { |
87 | - switch($this->post['type']) |
|
87 | + switch ($this->post['type']) |
|
88 | 88 | { |
89 | 89 | case 'blog' : |
90 | 90 | return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |