private function filterPath($path)
    {
        if ($path != null && substr($path, 0, 1) !== '/') {
            $path = '/' . $path;
        }

        return preg_replace_callback(
            '/(?:[^' . self::$charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
            function ($match) { return rawurlencode($match[0]); },
            $path
        );
    }
private function filterPath($path)
    {
        if ($path != null && substr($path, 0, 1) !== '/') {
            $path = '/' . $path;
        }

        return preg_replace_callback(
            '/(?:[^' . self::$charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
            function ($match) { return rawurlencode($match[0]); },
            $path
        );
    }
private function filterPath ( $ path ) { if ( $ path != null && substr ( $ path , 0 , 1 ) !== '/' ) { $ path = '/' . $ path ; } return preg_replace_callback ( '/(?:[^' . self :: $ charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/' , function ( $ match ) { return rawurlencode ( $ match [ 0 ] ) ; } , $ path ) ; }
Filters the path of a URI

@param $path

@return string
Filters the path of a URI