src/LfmPath.php
public function sortByColumn($arr_items)
    {
        $sort_by = $this->helper->input('sort_type');
        if (in_array($sort_by, ['name', 'time'])) {
            $key_to_sort = $sort_by;
        } else {
            $key_to_sort = 'name';
        }

        uasort($arr_items, function ($a, $b) use ($key_to_sort) {
            return strcmp($a->{$key_to_sort}, $b->{$key_to_sort});
        });

        return $arr_items;
    }
public function sortByColumn($arr_items)
    {
        $sort_by = $this->helper->input('sort_type');
        if (in_array($sort_by, ['name', 'time'])) {
            $key_to_sort = $sort_by;
        } else {
            $key_to_sort = 'name';
        }

        uasort($arr_items, function ($a, $b) use ($key_to_sort) {
            return strcmp($a->{$key_to_sort}, $b->{$key_to_sort});
        });

        return $arr_items;
    }
public function sortByColumn ( $ arr_items ) { $ sort_by = $ this -> helper -> input ( 'sort_type' ) ; if ( in_array ( $ sort_by , [ 'name' , 'time' ] ) ) { $ key_to_sort = $ sort_by ; } else { $ key_to_sort = 'name' ; } uasort ( $ arr_items , function ( $ a , $ b ) use ( $ key_to_sort ) { return strcmp ( $ a -> { $ key_to_sort } , $ b -> { $ key_to_sort } ) ; } ) ; return $ arr_items ; }
Sort files and directories.

@param  mixed  $arr_items  Array of files or folders or both.
@return array of object
Sort files and directories .