@param AMQPMessage $message

@return Span
969789
public function fromReceivedMessage(AMQPMessage $message)
    {
        return new Span(
            $this->getIdentifierOrGenerate($message, 'X-B3-SpanId'),
            $this->getMessageName($message),
            $this->getIdentifierOrGenerate($message, 'X-B3-TraceId'),
            [
                new Annotation(Annotation::SERVER_RECEIVE, $this->clock->microseconds(), $this->endpointResolver->resolve()),
            ],
            [],
            $this->getIdentifier($message, 'X-B3-ParentSpanId'),
            $this->getMessageHeader($message, 'X-B3-Flags') == '1'
        );
    }
720515
protected function formatMessage($message)
    {
        if (is_array($message)) {
            $message = var_export($message, true);
        } elseif (is_object($message)) {
            $message = get_object_vars($message);
        }

        return $message;
    }
86837
public function appendCustomMessage($message)
    {
        $customMessage = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', $message, '', 'custom-message');

        return $this->append($customMessage);
    }
712036
public function trans( $message ) {
		$theme  = wp_get_theme();
		$domain = $theme->get( 'TextDomain' );
		return __( $message, $domain );
	}
1295410
public function release(QueueMessage $message)
    {
        $queue = $message->getQueueName() ?: $this->queue;

        $this->client->releaseMessage(
            $queue,
            $message->getId(),
            $message->get('reservation_id'),
            $message->getDelay()
        );

        return $this;
    }
561578
private function getIdentifierOrGenerate(AMQPMessage $message, $header)
    {
        if (null === ($identifier = $this->getIdentifier($message, $header))) {
            $identifier = $this->identifierGenerator->generate();
        }

        return $identifier;
    }
167875
protected static function _processMessage( &$message )
    {
        $_newIndent = 0;

        foreach ( static::$_indentTokens as $_key => $_token )
        {
            if ( $_token == substr( $message, 0, $_length = strlen( $_token ) ) )
            {
                $_newIndent = ( false === $_key ? -1 : 1 );
                $message = substr( $message, $_length );
            }
        }

        return $_newIndent;
    }
67990
public function release(QueueMessage $message)
    {
        $this->client->release(
            new Job($message->getId(), ''),
            PheanstalkInterface::DEFAULT_PRIORITY,
            $message->getDelay()
        );

        return $this;
    }
910026
public function setStatusMessage($message)
    {
        $message = (string) trim($message);

        if ($message === '') {
            $this->statusMessage = $this->getStatusMessage();
        } else {
            $this->statusMessage = $message;
        }

        return $this;
    }
954639
public function getShortMessage($message)
    {
        static $hasMbString;

        if (null === $hasMbString) {
            $hasMbString = function_exists('mb_strlen');
        }

        $maxLength = 45;

        if ($hasMbString) {
            if (mb_strlen($message, 'UTF-8') > $maxLength) {
                $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
            }
        } else {
            if (strlen($message) > $maxLength) {
                $message = substr($message, 0, $maxLength - 4) . ' ...';
            }
        }

        return $message;
    }
157730
public function flashMessage($message)
	{
		$sessions = $this->getSessions()->getSessionSection('flash.message');
		$sessions->message = $message;
		$sessions->setExpiration('5 second');
		return $sessions->message;
	}
836416
public function prepareMessage($message, $properties = null)
    {
        if (empty($message)) {
            throw new Exception('AMQP message can not be empty');
        }
        if (is_array($message) || is_object($message)) {
            $message = Json::encode($message);
        }
        return new AMQPMessage($message, $properties);
    }
680901
public function appendMessage($message)
    {
        $context = $this->_context;

        $context->messages[$message->field][] = $message;

        return $this;
    }
124578
public function message($message)
    {
        if (is_string($message) || is_numeric($message)) {
            $message = new Text($message);
        }

        if (!($message instanceof Message)) {
            throw new InvalidArgumentException('Invalid message.');
        }

        $this->message = $message;

        return $this;
    }
809404
public function queue(Message $message)
	{
		// Get the gateway for the certificate
		$gateway = $this->getGatewayForCertificate( $message->getCertificate() );

		// Queue the message
		return $gateway->queue($message);
	}
750560
protected function translateMessage($message, array $parameters = array())
    {
        return $this->translator->trans($message, $parameters, $this->transDomain);
    }
386062
public function format($message) {
        $offset = 0;
        $output = '';
        $tagRegex = '[a-z][a-z0-9_=;-]*';
        preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE);
        foreach ($matches[0] as $i => $match) {
            $pos = $match[1];
            $text = $match[0];

            if (0 != $pos && '\\' == $message[$pos - 1]) {
                continue;
            }

            $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
            $offset = $pos + strlen($text);

            if ($open = '/' != $text[1]) {
                $tag = $matches[1][$i][0];
            }
            else {
                $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
            }

            if (!$open && !$tag) {
                // </>
                $this->styleStack->pop();
            }
            elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
                $output .= $this->applyCurrentStyle($text);
            }
            elseif ($open) {
                $this->styleStack->push($style);
            }
            else {
                $this->styleStack->pop($style);
            }
        }

        $output .= $this->applyCurrentStyle(substr($message, $offset));

        return str_replace('\\<', '<', $output);
    }