CraftCli\Handlebars\Loader\FilesystemLoader::normalizePath PHP Method

normalizePath() protected method

From https://github.com/thephpleague/flysystem/blob/master/src/Util.php
protected normalizePath ( string $path ) : string
$path string
return string
    protected function normalizePath($path)
    {
        // Remove any kind of funky unicode whitespace
        $normalized = preg_replace('#\\p{C}+|^\\./#u', '', $path);
        $normalized = $this->normalizeRelativePath($normalized);
        if (preg_match('#/\\.{2}|^\\.{2}/|^\\.{2}$#', $normalized)) {
            throw new LogicException('Path is outside of the defined root, path: [' . $path . '], resolved: [' . $normalized . ']');
        }
        $normalized = preg_replace('#\\\\{2,}#', '\\', trim($normalized, '\\'));
        $normalized = preg_replace('#/{2,}#', '/', trim($normalized, '/'));
        return $normalized;
    }