public static function filterUserInfo($info)
    {
        if (!\is_string($info)) {
            throw new \InvalidArgumentException('Uri user info must be a string');
        }

        return preg_replace_callback(
            '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u',
            function ($match) {
                return rawurlencode($match[0]);
            },
            $info
        ) ?? '';
    }
public static function filterUserInfo($info)
    {
        if (!\is_string($info)) {
            throw new \InvalidArgumentException('Uri user info must be a string');
        }

        return preg_replace_callback(
            '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u',
            function ($match) {
                return rawurlencode($match[0]);
            },
            $info
        ) ?? '';
    }
public static function filterUserInfo ( $ info ) { if ( ! \ is_string ( $ info ) ) { throw new \ InvalidArgumentException ( 'Uri user info must be a string' ) ; } return preg_replace_callback ( '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u' , function ( $ match ) { return rawurlencode ( $ match [ 0 ] ) ; } , $ info ) ?? '' ; }
Filters the user info string.

@param string $info The raw user or password.
@return string The percent-encoded user or password string.
@throws \InvalidArgumentException
Filters the user info string .