private function extractDirectories(string $path) : array
    {
        $remoteDirs = [];
        if (!empty($path)) {
            $remoteDirs = explode('/', $path);
            // fix empty first array element for absolute path
            if (substr($path, 0, 1) === '/') {
                $remoteDirs[0] = '/';
            }
            $remoteDirs = array_filter($remoteDirs);
        }
        return $remoteDirs;
    }
private function extractDirectories(string $path) : array
    {
        $remoteDirs = [];
        if (!empty($path)) {
            $remoteDirs = explode('/', $path);
            // fix empty first array element for absolute path
            if (substr($path, 0, 1) === '/') {
                $remoteDirs[0] = '/';
            }
            $remoteDirs = array_filter($remoteDirs);
        }
        return $remoteDirs;
    }
private function extractDirectories ( string $ path ) : array { $ remoteDirs = [ ] ; if ( ! empty ( $ path ) ) { $ remoteDirs = explode ( '/' , $ path ) ; // fix empty first array element for absolute path if ( substr ( $ path , 0 , 1 ) === '/' ) { $ remoteDirs [ 0 ] = '/' ; } $ remoteDirs = array_filter ( $ remoteDirs ) ; } return $ remoteDirs ; }
Return list of remote directories to travers.

@param  string $path
@return array
Return list of remote directories to travers .