src/Psalm/Internal/LanguageServer/LanguageServer.php
public static function pathToUri(string $filepath): string
    {
        $filepath = trim(str_replace('\\', '/', $filepath), '/');
        $parts = explode('/', $filepath);
        // Don't %-encode the colon after a Windows drive letter
        $first = array_shift($parts);
        if (substr($first, -1) !== ':') {
            $first = rawurlencode($first);
        }
        $parts = array_map('rawurlencode', $parts);
        array_unshift($parts, $first);
        $filepath = implode('/', $parts);
        return 'file:///' . $filepath;
    }
public static function pathToUri(string $filepath): string
    {
        $filepath = trim(str_replace('\\', '/', $filepath), '/');
        $parts = explode('/', $filepath);
        // Don't %-encode the colon after a Windows drive letter
        $first = array_shift($parts);
        if (substr($first, -1) !== ':') {
            $first = rawurlencode($first);
        }
        $parts = array_map('rawurlencode', $parts);
        array_unshift($parts, $first);
        $filepath = implode('/', $parts);
        return 'file:///' . $filepath;
    }
public static function pathToUri ( string $ filepath ) : string { $ filepath = trim ( str_replace ( '\\' , '/' , $ filepath ) , '/' ) ; $ parts = explode ( '/' , $ filepath ) ; // Don't %-encode the colon after a Windows drive letter $ first = array_shift ( $ parts ) ; if ( substr ( $ first , - 1 ) !== ':' ) { $ first = rawurlencode ( $ first ) ; } $ parts = array_map ( 'rawurlencode' , $ parts ) ; array_unshift ( $ parts , $ first ) ; $ filepath = implode ( '/' , $ parts ) ; return 'file:///' . $ filepath ; }
Transforms an absolute file path into a URI as used by the language server protocol.

@param string $filepath
@return string
Transforms an absolute file path into a URI as used by the language server protocol .