src/Http/Message/Uri.php
private function filterUserInfo(string $part): string
    {
        // Note the addition of `%` to initial charset; this allows `|` portion
        // to match and thus prevent double-encoding.
        return \preg_replace_callback(
            '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u',
            [$this, 'urlEncodeChar'],
            $part
        );
    }
private function filterUserInfo(string $part): string
    {
        // Note the addition of `%` to initial charset; this allows `|` portion
        // to match and thus prevent double-encoding.
        return \preg_replace_callback(
            '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u',
            [$this, 'urlEncodeChar'],
            $part
        );
    }
private function filterUserInfo ( string $ part ) : string { // Note the addition of `%` to initial charset; this allows `|` portion // to match and thus prevent double-encoding. return \ preg_replace_callback ( '/(?:[^%' . self :: CHAR_UNRESERVED . self :: CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u' , [ $ this , 'urlEncodeChar' ] , $ part ) ; }
Filters a part of user info in a URI to ensure it is properly encoded.

@param string $part

@return string
Filters a part of user info in a URI to ensure it is properly encoded .