Skip to content

Commit

Permalink
Merge pull request #2 from symfony-si/scrutinizer-patch-2
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
petk authored Jun 12, 2017
2 parents b41a7dd + ba436cb commit e4663ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AppBundle/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function findAll()
$finder = new Finder();
$finder->files()->in($this->path.'/app/Resources/content/blog');
$finder->files()->name('*.md');
$finder->sort(function ($a, $b) { return strcmp($b->getRealpath(), $a->getRealpath()); });
$finder->sort(function($a, $b) { return strcmp($b->getRealpath(), $a->getRealpath()); });

$posts = [];
foreach ($finder as $file) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public function findLatest($limit = 10)
$finder = new Finder();
$finder->files()->in($this->path.'/app/Resources/content/blog');
$finder->files()->name('*.md');
$finder->sort(function ($a, $b) { return strcmp($b->getRealpath(), $a->getRealpath()); });
$finder->sort(function($a, $b) { return strcmp($b->getRealpath(), $a->getRealpath()); });

$posts = [];
foreach (new \LimitIterator($finder->getIterator(), 0, $limit) as $file) {
Expand Down

0 comments on commit e4663ed

Please sign in to comment.