src/Security/Permission.php
public static function sort_permissions($a, $b)
    {
        if ($a['sort'] == $b['sort']) {
            // Same sort value, do alpha instead
            return strcmp($a['name'], $b['name']);
        } else {
            // Just numeric.
            return $a['sort'] < $b['sort'] ? -1 : 1;
        }
    }
public static function sort_permissions($a, $b)
    {
        if ($a['sort'] == $b['sort']) {
            // Same sort value, do alpha instead
            return strcmp($a['name'], $b['name']);
        } else {
            // Just numeric.
            return $a['sort'] < $b['sort'] ? -1 : 1;
        }
    }
public static function sort_permissions ( $ a , $ b ) { if ( $ a [ 'sort' ] == $ b [ 'sort' ] ) { // Same sort value, do alpha instead return strcmp ( $ a [ 'name' ] , $ b [ 'name' ] ) ; } else { // Just numeric. return $ a [ 'sort' ] < $ b [ 'sort' ] ? - 1 : 1 ; } }
Sort permissions based on their sort value, or name

@param array $a
@param array $b
@return int
Sort permissions based on their sort value or name