Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | public function init() |
||
19 | { |
||
20 | // We have special sorting rules for our items based on the date |
||
21 | // and title. This assumes that the items are actually Post instances. |
||
22 | uasort($this->items, function ($a, $b) { |
||
23 | return strnatcmp($b->date().' '.$b->title(), $a->date().' '.$a->title()); |
||
24 | }); |
||
25 | parent::init(); |
||
26 | } |
||
27 | } |
||
28 |