@@ -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 | |
@@ -39,20 +39,20 @@ discard block |
||
| 39 | 39 | public function perform() |
| 40 | 40 | { |
| 41 | 41 | $weighted_array = array(); |
| 42 | - foreach($this->result as $row) |
|
| 42 | + foreach ($this->result as $row) |
|
| 43 | 43 | { |
| 44 | 44 | $weight = $this->get_search_weight($row); |
| 45 | - if($weight > 0) |
|
| 45 | + if ($weight > 0) |
|
| 46 | 46 | $weighted_array[$row['id']] = $weight; |
| 47 | 47 | } |
| 48 | 48 | arsort($weighted_array); |
| 49 | 49 | |
| 50 | 50 | $final_array = array(); |
| 51 | - foreach($weighted_array as $id => $weight) |
|
| 51 | + foreach ($weighted_array as $id => $weight) |
|
| 52 | 52 | { |
| 53 | - foreach($this->result as $row) |
|
| 53 | + foreach ($this->result as $row) |
|
| 54 | 54 | { |
| 55 | - if($row['id'] == $id) |
|
| 55 | + if ($row['id'] == $id) |
|
| 56 | 56 | $final_array[] = $row; |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | private function get_search_weight($row) |
| 63 | 63 | { |
| 64 | 64 | $weight = 0; |
| 65 | - foreach($this->weight as $weight_array) |
|
| 65 | + foreach ($this->weight as $weight_array) |
|
| 66 | 66 | { |
| 67 | 67 | $text = $row[$weight_array['field']]; |
| 68 | 68 | $weight += $weight_array['weight'] * substr_count(strtolower($text), strtolower($this->query)); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | ], |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - return array_map(function ($row) { |
|
| 29 | + return array_map(function($row) { |
|
| 30 | 30 | return (object) $row; |
| 31 | 31 | }, $paths); |
| 32 | 32 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ], |
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | - return array_map(function ($row) { |
|
| 51 | + return array_map(function($row) { |
|
| 52 | 52 | return (object) $row; |
| 53 | 53 | }, $paths); |
| 54 | 54 | } |