Completed
Push — master ( 2b16eb...13f20e )
by Jacob
03:22
created
tests/unit/Domain/Blog/Post/MysqlPostRepositoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             )"
49 49
         );
50 50
 
51
-        self::$connection = new ConnectionLocator(function () use ($extendedPdo) {
51
+        self::$connection = new ConnectionLocator(function() use ($extendedPdo) {
52 52
             return $extendedPdo;
53 53
         });
54 54
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $this->assertInternalType('array', $data);
175 175
         $this->assertCount(count($testData), $data);
176 176
 
177
-        usort($testData, function ($rowA, $rowB) {
177
+        usort($testData, function($rowA, $rowB) {
178 178
             return ((new DateTime($rowA['date'])) < (new DateTime($rowB['date'])));
179 179
         });
180 180
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $this->assertNotFalse($data);
220 220
         $this->assertInternalType('array', $data);
221 221
 
222
-        $testData = array_filter($testData, function ($row) {
222
+        $testData = array_filter($testData, function($row) {
223 223
             return ($row['display'] == 1);
224 224
         });
225 225
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $this->assertNotFalse($data);
355 355
         $this->assertStringMatchesFormat('%d', $data);
356 356
 
357
-        $testData = array_filter($testData, function ($row) {
357
+        $testData = array_filter($testData, function($row) {
358 358
             return ($row['display'] == 1);
359 359
         });
360 360
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         $this->assertNotFalse($data);
472 472
         $this->assertInternalType('array', $data);
473 473
 
474
-        $testPostData = array_filter($testPostData, function ($row) {
474
+        $testPostData = array_filter($testPostData, function($row) {
475 475
             return ($row['display'] == 1);
476 476
         });
477 477
 
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         $this->assertNotFalse($data);
672 672
         $this->assertStringMatchesFormat('%d', $data);
673 673
 
674
-        $testPostData = array_filter($testPostData, function ($row) {
674
+        $testPostData = array_filter($testPostData, function($row) {
675 675
             return ($row['display'] == 1);
676 676
         });
677 677
 
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         $this->assertNotFalse($data);
770 770
         $this->assertInternalType('array', $data);
771 771
 
772
-        $testData = array_filter($testData, function ($row) {
772
+        $testData = array_filter($testData, function($row) {
773 773
             return ($row['display'] == 1);
774 774
         });
775 775
 
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
         $this->assertNotFalse($data);
922 922
         $this->assertStringMatchesFormat('%d', $data);
923 923
 
924
-        $testData = array_filter($testData, function ($row) {
924
+        $testData = array_filter($testData, function($row) {
925 925
             return ($row['display'] == 1);
926 926
         });
927 927
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
         $this->assertInternalType('array', $data);
1110 1110
 
1111 1111
         array_shift($testPostData);
1112
-        $testPostData = array_filter($testPostData, function ($row) {
1112
+        $testPostData = array_filter($testPostData, function($row) {
1113 1113
             return ($row['display'] == 1);
1114 1114
         });
1115 1115
 
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
         $this->assertInternalType('array', $data);
1182 1182
 
1183 1183
         array_shift($testPostData);
1184
-        $testPostData = array_filter($testPostData, function ($row) use ($testSeriesPostData) {
1184
+        $testPostData = array_filter($testPostData, function($row) use ($testSeriesPostData) {
1185 1185
             return (!in_array($row['id'], array_column($testSeriesPostData, 'post')));
1186 1186
         });
1187 1187
 
Please login to merge, or discard this patch.
controller/blog/PostController.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		parent::__construct();
27 27
 		
28 28
 		$this->post = PostCollector::getPostByURI(URLDecode::getPiece(2));
29
-		if($this->post == null)
29
+		if ($this->post == null)
30 30
 			$this->eject();
31 31
 		
32 32
 		$this->handle_comment_submit(
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		$keyword_array = array();
93 93
 		$keywords = $this->tags;
94 94
 		
95
-		foreach($keywords as $keyword)
95
+		foreach ($keywords as $keyword)
96 96
 		{
97 97
 			$keyword_array[] = $keyword->tag;
98 98
 		}
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 	private function get_series_posts()
107 107
 	{
108 108
 		$series_posts = $this->fetch_series_posts();
109
-		if(count($series_posts) < 1)
109
+		if (count($series_posts) < 1)
110 110
 			return array();
111 111
 		
112 112
 		$previous_post = new stdclass();
113 113
 		$next_post = new stdclass();
114 114
 		
115 115
 		$found_current_post = false;
116
-		foreach($series_posts as $post_row)
116
+		foreach ($series_posts as $post_row)
117 117
 		{
118
-			if($post_row['post'] == $this->post->id)
118
+			if ($post_row['post'] == $this->post->id)
119 119
 			{
120 120
 				$found_current_post = true;
121 121
 				continue;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 			$post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/";
143 143
 			
144
-			if(!$found_current_post)
144
+			if (!$found_current_post)
145 145
 				$previous_post = $post;
146 146
 			else
147 147
 			{
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	private $series_posts;
161 161
 	private function fetch_series_posts()
162 162
 	{
163
-      if(!isset($this->series_posts)) {
163
+      if (!isset($this->series_posts)) {
164 164
           global $container;
165 165
           $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']);
166 166
           $this->series_posts = $repository->getSeriesForPost($this->post->id);
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
 	private function get_related_posts()
172 172
 	{
173 173
 		$tag_array = array();
174
-		foreach($this->tags as $tag)
174
+		foreach ($this->tags as $tag)
175 175
 		{
176 176
 			$tag_array[] = $tag->id;
177 177
 		}
178 178
 		
179 179
 		$series_posts = $this->fetch_series_posts();
180 180
 		$exclude_post_array = array();
181
-		foreach($series_posts as $series_post)
181
+		foreach ($series_posts as $series_post)
182 182
 		{
183 183
 			$exclude_post_array[] = $series_post->post;
184 184
 		}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		$post_array = array();
187 187
 		$post_result = PostCollector::getRelatedPosts($this->post->id, $tag_array, $exclude_post_array);
188 188
 		
189
-		foreach($post_result as $post_row)
189
+		foreach ($post_result as $post_row)
190 190
 		{
191 191
 			$post = new stdclass();
192 192
 			$post->title = $post_row->title;
Please login to merge, or discard this patch.