@param string $path

@return string
333953
protected function normalizePath(string $path): string
    {
        if ('.{_format}' === substr($path, -10)) {
            $path = substr($path, 0, -10);
        }

        return $path;
    }
1333361
private function relativizePaths($path)
    {
        if (!$this->basePath) {
            return $path;
        }

        return str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
    }
1315709
public function normalize(string $path): string
    {
        [$scheme, $path] = $this->getSchemeAndHierarchy($path);

        $path = $this->normalizePathPart($path);

        return $this->toString($scheme, $path);
    }
48939
public function Path($Path = NULL) {
      if (is_string($Path)) {
         $Result = $this->_ParsedRequestElement('Path', $Path);
      } else {
         $Result = $this->_ParsedRequestElement('Path');
         if ($Path === TRUE) {
            // Encode the path.
            $Parts = explode('/', $Result);
            $Parts = array_map('urlencode', $Parts);
            $Result = implode('/', $Parts);
         }
      }
      
      return $Result;
   }
1014567
protected function _path($path) {
		if (($file = $this->stat($path)) == false) {
			return '';
		}
		
		$parentsIds = $this->getParents($path);
		$path = '';
		foreach ($parentsIds as $id) {
			$dir = $this->stat($id);
			$path .= $dir['name'].$this->separator;
		}
		return $path.$file['name'];
	}
556400
public static function cleanFilePathname($path) {
		if (UString::isNotNull ( $path )) {
			if (\DS === "/")
				$path = \str_replace ( "\\", \DS, $path );
			else
				$path = \str_replace ( "/", \DS, $path );
			$path = \str_replace ( \DS . \DS, \DS, $path );
		}
		return $path;
	}
808377
public static function getAbsolutePath(string $path): string
    {
        $parts = \preg_split('~[/\\\\]+~', $path, 0, \PREG_SPLIT_NO_EMPTY);
        $absolutes = [];
        foreach ($parts as $part) {
            if ('.' === $part) {
                continue;
            }
            if ('..' === $part) {
                \array_pop($absolutes);
            } else {
                $absolutes[] = $part;
            }
        }

        /**
         * Allows to dereference char
         */
        $__FILE__ = \preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
        $prefix = $__FILE__[0] === \DIRECTORY_SEPARATOR ? \DIRECTORY_SEPARATOR : '';
        return $prefix . \implode(\DIRECTORY_SEPARATOR, $absolutes);
    }
26871
private function formatPath(string $path): string
    {
        $path = $this->formatDataPath($path);

        static $pattern = '/(?:[^'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.'%:@\/}{]++\|%(?![A-Fa-f0-9]{2}))/';

        $path = (string) preg_replace_callback($pattern, [Uri::class, 'urlEncodeMatch'], $path);

        return $this->formatFilePath($path);
    }
339132
public static function type(string $path): string
    {
        $result = @filetype($path);
        return $result !== false ? $result : '';
    }
664554
protected function path($path)
    {
        if (strpos($path, './') === 0) {
            return $this->dir . '/' . substr($path, 2);
        }

        if (strpos($path, '../') === 0) {
            return dirname($this->dir) . '/' . substr($path, 3);
        }

        return $path;
    }
498031
private function getPath(string $path) : string
  {
    $path = str_replace('"', "", $path);
    $path = str_replace("'", "", $path);

    $views = self::$views;
    $file = explode('.', $path);

    foreach($file as $name) {
      if (is_dir($views . DIRECTORY_SEPARATOR . $name)) {
        $views = $views . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR;
      }
      else {
        $views = $views . (ends_with($views, '/') ? '' : '.') . $name;
      }
    }

    $parent = substr(self::$views, strrpos(self::$views, DIRECTORY_SEPARATOR) + 1);

    if (str_contains($views, $parent . '.')) {
      $views = str_replace($parent . '.', $parent . DIRECTORY_SEPARATOR, $views);
    }

    return str_replace(self::$views, '', $views);
  }
264905
public function read(string $path): string
    {
        $path = $this->normalizePath($path);
        $this->assertPresent($path);

        return $this->getAdapter()->read($path);
    }
1289185
public static function formatPath($path)
    {
        if ($path == DIRECTORY_SEPARATOR) {
            return $path;
        }
        return trim($path) ? rtrim(trim($path), DIRECTORY_SEPARATOR) : '';
    }
1058400
private function cleanPath($path)
  {
    $path = substr($path, 0, 1) == '/' ? substr($path, 1, strlen($path) - 1) : $path;
    $path = substr($path, strlen($path) - 1, 1) == '/' ? substr($path, 0, strlen($path) - 1) : $path;

    $path = substr($path, 0, 1) == '\\' ? substr($path, 1, strlen($path) - 1) : $path;
    $path = substr($path, strlen($path) - 1, 1) == '\\' ? substr($path, 1, strlen($path) - 1) : $path;

    $path = preg_replace('#' . $this->DS . '+#', $this->DS, $path);

    return $path;
  }
658302
public function applyPathPrefix($path)
    {
        $path = ltrim($path, '/');
        if (strlen($path) === 0) {
            return rtrim($this->getPathPrefix(), '/');
        }

        return $this->getPathPrefix() . $path;
    }
934235
public static function original(string $path): string
    {
        $result = $path;
        $version = self::version($path);
        if ($version) {
            $version = self::VERSION_SEPARATOR . $version;
            $result = str_replace($version, '', $result);
        }

        return $result;
    }
885525
public static function clean_up_path($path)
    {

        if (empty($path)) return '';
        if (strpos($path, '\\') !== false) {
            return str_replace("\\\\", "\\", $path);
        } else {
            return str_replace("//", "/", $path);
        }
    }