public static function combine(string ... $paths) : string
    {
        $paths = array_map([__CLASS__, 'normalize'], $paths);

        $paths = array_filter($paths, function ($path) {
            return trim($path, DIRECTORY_SEPARATOR) !== '.';
        });

        $combinedPath = implode(DIRECTORY_SEPARATOR, $paths);

        return self::stringReplaceIgnoringStreamWrapper(
            DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
            DIRECTORY_SEPARATOR,
            $combinedPath
        );
    }