original_string: 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
          ) ?? '';
      }
code: 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
          ) ?? '';
      }
code_tokens: 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 ) ?? '' ; }
docstring: Filters the user info string.
  
  @param string $info The raw user or password.
  @return string The percent-encoded user or password string.
  @throws \InvalidArgumentException
docstring_tokens: Filters the user info string .