normalizeMessage

@param string $message

@return  string
511144
public static function normalizeMessage($message)
    {
        if (Mbstring::isUtf8($message)) {
            $message = str_replace('%20', ' ', rawurlencode($message));
        }

        return trim(explode("\n", $message)[0]);
    }
554929
public static function t($message)
    {
        if (!isset(static::$_handlers[static::$_domain])) {
            static::loadHandler('Horde_Translation_Handler_Gettext');
        }
        return static::$_handlers[static::$_domain]->t($message);
    }
851131
public function translate($message, ... $parameters): string {
    $count = $parameters[0] ?? 0;
    $params = $parameters[1] ?? [];
    list($domain, $m) = $this->extractDomainAndMessage($message);
    $texts = Arrays::get($this->loader->getTexts(), $domain, []);
    $parts = explode(".", $m);
    if(count($parts) === 1) {
      $parts = [$m];
    }
    $text = $this->multiLevelTrans($parts, $texts);
    if($text === "") {
      $this->onUntranslated($message);
      return $message;
    }
    if($this->messageSelector->isMultiChoice($text)) {
      $text = $this->messageSelector->choose($text, $count);
    }
    $params["count"] = $count;
    foreach($params as $key => $value) {
      $text = str_replace("%$key%", $value, $text);
    }
    return $text;
  }
304638
protected function splitMessage($message)
    {
        if ($this->mode == self::MODE_STRICT) {
            $pos    = strpos($message, Http::NEW_LINE . Http::NEW_LINE);
            $header = substr($message, 0, $pos);
            $body   = trim(substr($message, $pos + 1));
        } elseif ($this->mode == self::MODE_LOOSE) {
            $lines  = explode("\n", $message);
            $header = '';
            $body   = '';
            $found  = false;
            $count  = count($lines);

            foreach ($lines as $i => $line) {
                $line = trim($line);

                if (!$found && empty($line)) {
                    $found = true;
                    continue;
                }

                if (!$found) {
                    $header.= $line . Http::NEW_LINE;
                } else {
                    $body.= $line . ($i < $count - 1 ? "\n" : '');
                }
            }
        }

        return array($header, $body);
    }
1262182
public static function formatMessage($message): string
    {
        if ($message instanceof \Throwable) {
            while ($message) {
                $tmp[] = ($message instanceof \ErrorException
                        ? Helpers::errorTypeToString($message->getSeverity()) . ': ' . $message->getMessage()
                        : Helpers::getClass($message) . ': ' . $message->getMessage() . ($message->getCode() ? ' #' . $message->getCode() : '')
                    ) . ' in ' . $message->getFile() . ':' . $message->getLine();
                $message = $message->getPrevious();
            }
            $message = \implode("\ncaused by ", $tmp);

        } elseif (!\is_string($message)) {
            $message = self::toText($message);
        }

        return \trim($message);
    }
237768
private function formatMessage(string $message, array $params): string
    {
        $params = \array_values($params);
        \array_unshift($params, $message);
        
        return \sprintf(...$params);
    }
465022
public function formatProfileMessage($message)
    {
        $sqlStart = strpos($message, '(') + 1;
        $sqlEnd = strrpos($message, ')');
        $sqlLength = $sqlEnd - $sqlStart;
        $message = substr($message, $sqlStart, $sqlLength);
        $message = strtr($message, array(
            ' FROM ' => "\nFROM ",
            ' VALUES ' => "\nVALUES ",
            ' WHERE ' => "\nWHERE ",
            ' ORDER BY ' => "\nORDER BY ",
            ' GROUP BY ' => "\nGROUP BY ",
            ' LIMIT ' => "\nLIMIT ",
            ' AND ' => "\n\tAND ",
            ', ' => ",\n\t ",
        ));
        if (strpos($message, '. Bound with ') !== false) {
            list($query, $params) = explode('. Bound with ', $message);
            $binds = array();
            $matchResult = preg_match_all("/(?<key>[a-z0-9\.\_\-\:]+)=(?<value>[\d\.e\-\+]+|''|'.+?(?<!\\\)')/ims", $params, $paramsMatched, PREG_SET_ORDER);
            if ($matchResult) {
                foreach ($paramsMatched as $paramsMatch)
                    if (isset($paramsMatch['key'], $paramsMatch['value']))
                        $binds[':' . trim($paramsMatch['key'], ': ')] = trim($paramsMatch['value']);
            }
            $message = strtr($query, $binds);
        }
        return strip_tags($this->getTextHighlighter()->highlight($message), '<div>,<span>');
    }
1024931
protected function formatMessage( $message )
	{
		if ( is_array( $message ) )
			return var_export( $message, true );
		elseif ( $message instanceof Jsonable )
			return $message->toJson();
		elseif ( $message instanceof Arrayable )
			return var_export( $message->toArray(), true );

		return $message;
	}
462731
public function translate($message, array $params = array())
    {
        // Update the current message with the domain translation, if we have one.
        if (isset($this->messages[$message]) && ! empty($this->messages[$message])) {
            $message = $this->messages[$message];
        }

        if (empty($params)) {
            return $message;
        }

        $formatter = new MessageFormatter();

        return $formatter->format($message, $params, $this->locale);
    }
712036
public function trans( $message ) {
		$theme  = wp_get_theme();
		$domain = $theme->get( 'TextDomain' );
		return __( $message, $domain );
	}
1128738
function getMessageSignature($message)
    {
        $pairs = $this->_makePairs($message);
        return base64_encode($this->sign($pairs));
    }
800622
private function buildMessage(AppleMessage $message): string
    {
        $jsonMessage = json_encode($message->getMessage());
        $jsonMessageLength = strlen($jsonMessage);

        $payload =
            pack(
                'CNNnH*n',
                self::COMMAND,
                $message->getIdentifier(),
                $message->getExpiresAt(),
                self::TOKEN_SIZE,
                $message->getDeviceToken(),
                $jsonMessageLength
            );
        $payload .= $jsonMessage;

        return $payload;
    }
779071
private Object [] normalizeMessageArgs(Object [] args) {
    Object [] result = args;
    if(args != null && args.length > 0) {
      result = new Object[args.length];
      for(int i = 0; i < args.length; i++) {
        if(args[i] == null || args[i] instanceof CharSequence || args[i] instanceof Number) {
          result[i] = args[i];
        } else {
          result[i] = args[i].toString();
        }
      }
    }
    return result;
  }
723078
public function message($message=null) {
        if(is_null($message)) {
            return $this->message;
        }
        $this->message = $message;
    }
774220
public function resolvePackage(string $message): ?string
    {
        $match = Strings::match($message, self::PACKAGE_NAME_PATTERN);
        if (! isset($match['package'])) {
            return Package::UNKNOWN;
        }

        return $this->packageAliases[$match['package']] ?? $match['package'];
    }
363820
public static function normalizeMethodName(string $method): string
    {
        // Methods cant start with a number in PHP - move it after text
        $method = preg_replace('{^([0-9]*)(.*)}', '$2$1', $method);
        if (is_numeric($method)) {
            $method = 'call' . $method;
        }

        // Methods cant be named after reserved keywords.
        $method = self::normalizeReservedKeywords($method, 'Call');

        return lcfirst(self::camelCase($method, '{[^a-z0-9_]+}i'));
    }
1315814
public static function createMessage(string $message): string
    {
        $lastErrorMessage = error_get_last();
        if ($lastErrorMessage !== null) {
            $message .= "; ".$lastErrorMessage["message"];
        }
        return $message;
    }