Skip to content

Commit 7f300e6

Browse files
committed
Sort by occurrences by default
1 parent 622f605 commit 7f300e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PHPCtags.class.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ private function getAccess($node)
3636
return 'public';
3737
}
3838

39+
private static function helperSortByLine($a, $b) {
40+
return $a['line'] > $b['line'] ? 1 : 0;
41+
}
42+
3943
private function struct($node, $parent=array())
4044
{
4145
static $scope = array();
@@ -137,6 +141,8 @@ private function struct($node, $parent=array())
137141

138142
if(!empty($parent)) array_pop($scope);
139143

144+
usort($structs, 'self::helperSortByLine');
145+
140146
return $structs;
141147
}
142148

0 commit comments

Comments
 (0)