for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symplify\PHP7_Sculpin\PostsBundle;
use Symplify\PHP7_Sculpin\ProxySourceCollection\ProxySourceCollection;
final class Posts extends ProxySourceCollection
{
public function init()
// We have special sorting rules for our items based on the date
// and title. This assumes that the items are actually Post instances.
uasort($this->items, function ($a, $b) {
return strnatcmp($b->date().' '.$b->title(), $a->date().' '.$a->title());
});
parent::init();
}