Latte\Loaders\FileLoader::normalizePath PHP Method

normalizePath() private static method

private static normalizePath ( $path ) : string
return string
    private static function normalizePath($path)
    {
        $res = [];
        foreach (explode('/', strtr($path, '\\', '/')) as $part) {
            if ($part === '..' && $res && end($res) !== '..') {
                array_pop($res);
            } elseif ($part !== '.') {
                $res[] = $part;
            }
        }
        return implode(DIRECTORY_SEPARATOR, $res);
    }