public static function normalizePath($path, $filter = ['', '.', '..'], $separator = '/')
    {
        $parts = explode('/', trim(str_replace('\\', '/', $path), '/'));

        $filterMethod = function ($segment) use ($filter) {
            return !in_array($segment, $filter);
        };

        return join($separator, array_filter($parts, $filterMethod));
    }