src/Url.php
protected function getCanonicalizedPath($path) {

        $newPath = array();
        foreach(explode('/', $path) as $segment) {

            if($segment === '' || $segment === '.') {

                continue;
            }

            elseif($segment === '..') {

                array_pop($newPath);
            }

            else {

                array_push($newPath, $segment);
            }
        }

        return implode('/', $newPath);
    }
protected function getCanonicalizedPath($path) {

        $newPath = array();
        foreach(explode('/', $path) as $segment) {

            if($segment === '' || $segment === '.') {

                continue;
            }

            elseif($segment === '..') {

                array_pop($newPath);
            }

            else {

                array_push($newPath, $segment);
            }
        }

        return implode('/', $newPath);
    }
@param string $path

@return string