@@ -56,11 +56,11 @@ |
||
| 56 | 56 | final private function get_list_posts() |
| 57 | 57 | { |
| 58 | 58 | $post_array = array(); |
| 59 | - foreach($this->get_list_results() as $post) |
|
| 59 | + foreach ($this->get_list_results() as $post) |
|
| 60 | 60 | { |
| 61 | 61 | $post_array[] = $this->format_post($post, true); |
| 62 | 62 | } |
| 63 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
| 63 | + if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
| 64 | 64 | $this->eject(); |
| 65 | 65 | return $post_array; |
| 66 | 66 | } |
@@ -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?'; |
@@ -4,5 +4,5 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface LogRepositoryInterface |
| 6 | 6 | { |
| 7 | - public function getActiveLogs($limit = null, $offset= 0); |
|
| 7 | + public function getActiveLogs($limit = null, $offset = 0); |
|
| 8 | 8 | } |
@@ -4,5 +4,5 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface WaterfallRepositoryInterface |
| 6 | 6 | { |
| 7 | - public function getWaterfalls($limit = null, $offset= 0); |
|
| 7 | + public function getWaterfalls($limit = null, $offset = 0); |
|
| 8 | 8 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | )" |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
| 32 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
| 33 | 33 | return $extendedPdo; |
| 34 | 34 | }); |
| 35 | 35 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $this->assertNotFalse($data); |
| 250 | 250 | $this->assertInternalType('array', $data); |
| 251 | 251 | |
| 252 | - $testData = array_filter($testData, function ($row) { |
|
| 252 | + $testData = array_filter($testData, function($row) { |
|
| 253 | 253 | return ($row['type'] == 'type one'); |
| 254 | 254 | }); |
| 255 | 255 | $testData = array_values($testData); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $this->assertInternalType('array', $data); |
| 319 | 319 | $this->assertCount(2, $data); |
| 320 | 320 | |
| 321 | - $testData = array_filter($testData, function ($row) { |
|
| 321 | + $testData = array_filter($testData, function($row) { |
|
| 322 | 322 | return ($row['type'] == 'type one'); |
| 323 | 323 | }); |
| 324 | 324 | $testData = array_values($testData); |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $repository = new MysqlActivityRepository(self::$connection); |
| 385 | 385 | $data = $repository->getActivitiesByTypeCount('type one'); |
| 386 | 386 | |
| 387 | - $testData = array_filter($testData, function ($row) { |
|
| 387 | + $testData = array_filter($testData, function($row) { |
|
| 388 | 388 | return ($row['type'] == 'type one'); |
| 389 | 389 | }); |
| 390 | 390 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | )" |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
| 32 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
| 33 | 33 | return $extendedPdo; |
| 34 | 34 | }); |
| 35 | 35 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | )" |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
| 45 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
| 46 | 46 | return $extendedPdo; |
| 47 | 47 | }); |
| 48 | 48 | } |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | $repository = new MysqlSeriesRepository(self::$connection); |
| 181 | 181 | $data = $repository->getSeriesForPost(reset($testPostData)['id']); |
| 182 | 182 | |
| 183 | - usort($testPostData, function ($rowA, $rowB) use ($testSeriesPostData) { |
|
| 184 | - $seriesA = array_filter($testSeriesPostData, function ($row) use ($rowA) { |
|
| 183 | + usort($testPostData, function($rowA, $rowB) use ($testSeriesPostData) { |
|
| 184 | + $seriesA = array_filter($testSeriesPostData, function($row) use ($rowA) { |
|
| 185 | 185 | return ($rowA['id'] == $row['post']); |
| 186 | 186 | }); |
| 187 | - $seriesB = array_filter($testSeriesPostData, function ($row) use ($rowB) { |
|
| 187 | + $seriesB = array_filter($testSeriesPostData, function($row) use ($rowB) { |
|
| 188 | 188 | return ($rowB['id'] == $row['post']); |
| 189 | 189 | }); |
| 190 | 190 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $this->assertNotFalse($data); |
| 309 | 309 | $this->assertInternalType('array', $data); |
| 310 | 310 | |
| 311 | - $testPostData = array_filter($testPostData, function ($row) { |
|
| 311 | + $testPostData = array_filter($testPostData, function($row) { |
|
| 312 | 312 | return ($row['display'] == 1); |
| 313 | 313 | }); |
| 314 | 314 | $testPosts = array_column($testPostData, 'id'); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | )" |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
| 32 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
| 33 | 33 | return $extendedPdo; |
| 34 | 34 | }); |
| 35 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | )" |
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | - self::$connection = new ConnectionLocator(function () use ($extendedPdo) { |
|
| 43 | + self::$connection = new ConnectionLocator(function() use ($extendedPdo) { |
|
| 44 | 44 | return $extendedPdo; |
| 45 | 45 | }); |
| 46 | 46 | } |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | $this->assertNotFalse($data); |
| 201 | 201 | $this->assertInternalType('array', $data); |
| 202 | 202 | |
| 203 | - $tagCountData = array_map(function ($row) use ($testTagData) { |
|
| 203 | + $tagCountData = array_map(function($row) use ($testTagData) { |
|
| 204 | 204 | $tag = $row['tag_id']; |
| 205 | - $tag = array_filter($testTagData, function ($row) use ($tag) { |
|
| 205 | + $tag = array_filter($testTagData, function($row) use ($tag) { |
|
| 206 | 206 | return ($tag == $row['id']); |
| 207 | 207 | }); |
| 208 | 208 | $tag = current($tag)['tag']; |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $this->assertCount(count($testCountData), $data); |
| 231 | 231 | |
| 232 | - usort($testCountData, function ($rowA, $rowB) { |
|
| 232 | + usort($testCountData, function($rowA, $rowB) { |
|
| 233 | 233 | return ($rowA['tag'] > $rowB['tag']); |
| 234 | 234 | }); |
| 235 | - usort($data, function ($rowA, $rowB) { |
|
| 235 | + usort($data, function($rowA, $rowB) { |
|
| 236 | 236 | return ($rowA['tag'] > $rowB['tag']); |
| 237 | 237 | }); |
| 238 | 238 | |
@@ -298,18 +298,18 @@ discard block |
||
| 298 | 298 | $this->assertNotFalse($data); |
| 299 | 299 | $this->assertInternalType('array', $data); |
| 300 | 300 | |
| 301 | - $testPTLinkData = array_filter($testPTLinkData, function ($row) use ($testPostData) { |
|
| 301 | + $testPTLinkData = array_filter($testPTLinkData, function($row) use ($testPostData) { |
|
| 302 | 302 | $post = $row['post_id']; |
| 303 | - $post = array_filter($testPostData, function ($row) use ($post) { |
|
| 303 | + $post = array_filter($testPostData, function($row) use ($post) { |
|
| 304 | 304 | return ($post == $row['id']); |
| 305 | 305 | }); |
| 306 | 306 | $post = current($post); |
| 307 | 307 | return ($post['display'] == 1); |
| 308 | 308 | }); |
| 309 | 309 | |
| 310 | - $tagCountData = array_map(function ($row) use ($testTagData) { |
|
| 310 | + $tagCountData = array_map(function($row) use ($testTagData) { |
|
| 311 | 311 | $tag = $row['tag_id']; |
| 312 | - $tag = array_filter($testTagData, function ($row) use ($tag) { |
|
| 312 | + $tag = array_filter($testTagData, function($row) use ($tag) { |
|
| 313 | 313 | return ($tag == $row['id']); |
| 314 | 314 | }); |
| 315 | 315 | $tag = current($tag)['tag']; |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | $this->assertCount(count($testCountData), $data); |
| 338 | 338 | |
| 339 | - usort($testCountData, function ($rowA, $rowB) { |
|
| 339 | + usort($testCountData, function($rowA, $rowB) { |
|
| 340 | 340 | return ($rowA['tag'] > $rowB['tag']); |
| 341 | 341 | }); |
| 342 | - usort($data, function ($rowA, $rowB) { |
|
| 342 | + usort($data, function($rowA, $rowB) { |
|
| 343 | 343 | return ($rowA['tag'] > $rowB['tag']); |
| 344 | 344 | }); |
| 345 | 345 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $this->assertInternalType('array', $data); |
| 415 | 415 | $this->assertCount(count($testTagData), $data); |
| 416 | 416 | |
| 417 | - usort($testTagData, function ($rowA, $rowB) { |
|
| 417 | + usort($testTagData, function($rowA, $rowB) { |
|
| 418 | 418 | return ($rowA['tag'] > $rowB['tag']); |
| 419 | 419 | }); |
| 420 | 420 | |