Completed
Push — master ( 94c6c2...ff31a4 )
by Jacob
04:23
created
controller/blog/DefaultPageController.class.inc.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function set_head_data()
20 20
 	{
21
-    $this->set_head('rss_link', [
22
-      'title' => 'Jacob Emerick Blog Feed',
23
-      'url' => '/rss.xml'
24
-    ]);
25
-    $this->set_head('rss_comment_link', [
26
-      'title' => 'Jacob Emerick Blog Comment Feed',
27
-      'url' => '/rss-comments.xml'
28
-    ]);
21
+	$this->set_head('rss_link', [
22
+	  'title' => 'Jacob Emerick Blog Feed',
23
+	  'url' => '/rss.xml'
24
+	]);
25
+	$this->set_head('rss_comment_link', [
26
+	  'title' => 'Jacob Emerick Blog Comment Feed',
27
+	  'url' => '/rss-comments.xml'
28
+	]);
29 29
 		
30 30
 		$this->add_css('normalize');
31 31
 		$this->add_css('blog');
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 
88 88
 	final private function get_tags_for_post($post)
89 89
 	{
90
-        global $container;
91
-        $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
92
-        $tag_result = $repository->getTagsForPost($post['id']);
90
+		global $container;
91
+		$repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
92
+		$tag_result = $repository->getTagsForPost($post['id']);
93 93
 
94
-        $tag_array = array();
94
+		$tag_array = array();
95 95
 		foreach($tag_result as $tag)
96 96
 		{
97 97
 			$tag_object = new stdclass();
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
 	final private function get_tag_cloud()
127 127
 	{
128
-        global $container;
129
-        $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
130
-        $tag_result = $repository->getTagCloud();
128
+		global $container;
129
+		$repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
130
+		$tag_result = $repository->getTagCloud();
131 131
 		
132 132
 		$maximum_tag_count = $this->get_maximum_tag_count($tag_result);
133 133
 		
@@ -176,43 +176,43 @@  discard block
 block discarded – undo
176 176
 			$array[] = $comment_obj;
177 177
 		}
178 178
 
179
-    $comment_service_array = $this->get_comments_from_service();
180
-    if ($comment_service_array !== $array) {
181
-      global $container;
182
-      $container['console']->log('Mismatch between comment service and legacy db');
183
-      $container['console']->log($comment_service_array[0]);
184
-      $container['console']->log($array[0]);
185
-    }
179
+	$comment_service_array = $this->get_comments_from_service();
180
+	if ($comment_service_array !== $array) {
181
+	  global $container;
182
+	  $container['console']->log('Mismatch between comment service and legacy db');
183
+	  $container['console']->log($comment_service_array[0]);
184
+	  $container['console']->log($array[0]);
185
+	}
186 186
 		return $array;
187 187
 	}
188 188
 
189
-    final private function get_comments_from_service()
190
-    {
191
-        global $config;
192
-        $configuration = new Jacobemerick\CommentService\Configuration();
193
-        $configuration->setUsername($config->comments->user);
194
-        $configuration->setPassword($config->comments->password);
195
-        $configuration->addDefaultHeader('Content-Type', 'application/json');
196
-        $configuration->setHost($config->comments->host);
197
-        $configuration->setCurlTimeout($config->comments->timeout);
198
-
199
-        $client = new Jacobemerick\CommentService\ApiClient($configuration);
200
-        $api = new Jacobemerick\CommentService\Api\DefaultApi($client);
201
-        $comment_response = $api->getComments(1, self::$RECENT_COMMENT_COUNT, '-date', 'blog.jacobemerick.com');
202
-
203
-        $array = array();
204
-        foreach($comment_response as $comment)
205
-        {
206
-            $body = $comment->getBody();
207
-            $body = strip_tags($body);
208
-
209
-            $comment_obj = new stdclass();
210
-            $comment_obj->description = Content::instance('SmartTrim', $body)->activate(30);
211
-            $comment_obj->commenter = $comment->getCommenter()->getName();
212
-            $comment_obj->link = "{$comment->getUrl()}/#comment-{$comment->getId()}";
213
-            $array[] = $comment_obj;
214
-        }
215
-        return $array;
216
-    }
189
+	final private function get_comments_from_service()
190
+	{
191
+		global $config;
192
+		$configuration = new Jacobemerick\CommentService\Configuration();
193
+		$configuration->setUsername($config->comments->user);
194
+		$configuration->setPassword($config->comments->password);
195
+		$configuration->addDefaultHeader('Content-Type', 'application/json');
196
+		$configuration->setHost($config->comments->host);
197
+		$configuration->setCurlTimeout($config->comments->timeout);
198
+
199
+		$client = new Jacobemerick\CommentService\ApiClient($configuration);
200
+		$api = new Jacobemerick\CommentService\Api\DefaultApi($client);
201
+		$comment_response = $api->getComments(1, self::$RECENT_COMMENT_COUNT, '-date', 'blog.jacobemerick.com');
202
+
203
+		$array = array();
204
+		foreach($comment_response as $comment)
205
+		{
206
+			$body = $comment->getBody();
207
+			$body = strip_tags($body);
208
+
209
+			$comment_obj = new stdclass();
210
+			$comment_obj->description = Content::instance('SmartTrim', $body)->activate(30);
211
+			$comment_obj->commenter = $comment->getCommenter()->getName();
212
+			$comment_obj->link = "{$comment->getUrl()}/#comment-{$comment->getId()}";
213
+			$array[] = $comment_obj;
214
+		}
215
+		return $array;
216
+	}
217 217
 
218 218
 }
Please login to merge, or discard this patch.