private function normalizeDir($dir)
    {
        $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);

        if (preg_match('#^s?ftp://#', $dir)) {
            $dir .= '/';
        }

        return $dir;
    }
private function normalizeDir($dir)
    {
        $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);

        if (preg_match('#^s?ftp://#', $dir)) {
            $dir .= '/';
        }

        return $dir;
    }
private function normalizeDir ( $ dir ) { $ dir = rtrim ( $ dir , '/' . \ DIRECTORY_SEPARATOR ) ; if ( preg_match ( '#^s?ftp://#' , $ dir ) ) { $ dir .= '/' ; } return $ dir ; }
Normalizes given directory names by removing trailing slashes.

Excluding: (s)ftp:// wrapper

@param string $dir

@return string
Normalizes given directory names by removing trailing slashes .