Test a message against a number of validators.

@param Message $message
19026
public function validate(Message $message)
    {
        /** @var Validator $validator */
        foreach ($this->validators as $validator) {
            $validator->validate($message);
        }
    }
1325422
protected function validate($input, array &$messages)
    {
        if (!preg_match(ColourStringParser::REGEX_RGBA, $input)) {
            $messages[] = new Message(self::MESSAGE);
        }
    }
1104036
public function logMessage(Message $message): void
    {
        if (in_array($message->getLevel(), $this->config['log'])) {
            if ($this->config['send_immediately']) {

                call_user_func($this->config['exec'], $message);

            } else {
                $this->messages[] = $message;

                if (count($this->messages) == 1) {
                    // register shutdown on first message in queue
                    $self = $this;
                    register_shutdown_function(function () use ($self) {
                        $fn = $self->getExecFunction();
                        call_user_func($fn, $self->getMessages());
                    });
                }
            }
        }
    }
747683
protected function applyMessageOptions(Message $message)
    {
        if (empty($this->config['message']['options']) || !is_array($this->config['message']['options'])) {
            return $message;
        }

        foreach ($this->config['message']['options'] as $key => $value) {
            $method = 'set'.ucfirst($key);

            if (is_callable(array($message, $method))) {
                if (!is_array($value)) {
                    $value = array($value);
                }
                call_user_func_array(array($message, $method), $value);
            }
        }

        return $message;
    }
484057
protected function note(...$message): void
    {
        if ($this->notice instanceof Notice) {
            $this->notice->add($message);
        }
    }
75101
public function hasMessage(GmailMessageInterface $message): bool
    {
        if ($this->messages->contains($message)) {
            return true;
        }

        return false;
    }
544542
protected function assertMessageExists(int $messageNumber): void
    {
        if (true === $this->messageNumberVerified) {
            return;
        }
        $this->messageNumberVerified = true;

        $msgno = \imap_msgno($this->resource->getStream(), $messageNumber);
        if (\is_numeric($msgno) && $msgno > 0) {
            $this->imapMsgNo = $msgno;

            return;
        }

        throw new MessageDoesNotExistException(\sprintf(
            'Message "%s" does not exist',
            $messageNumber
        ));
    }
1283242
public function message($message)
    {
        if(trim($message))
        {
            $msg = new stdClass();
            $msg->type = 'text';
            $msg->message = $message;
            $this->messages[] = $msg;
        }        
    }
1009275
public function debug($message)
    {
        Dispatcher::getInstance()->dispatch(
            'system.debug',
            DebugEvent::createInstance($this)
                ->setMessage($message)
        );
    }
751230
public function assertNotMultipleSuccessMessage(TableNode $messages)
    {
        $this->assertValidMessageTable($messages, 'success messages');
        foreach ($messages->getHash() as $key => $value) {
            $value = array_change_key_case($value);
            $message = trim($value['success messages']);
            $this->assertNotSuccessMessage($message);
        }
    }
852757
protected function _handleLdapError($message)
    {
        $extendedError = $this->_ldap->getDiagnosticMessage();
        if (!is_null($extendedError)) {
            $this->_errors[] = $extendedError;
        }
        $this->_errors[] = $message;
    }
264683
protected function validate(array $input, array &$messages)
    {
        if (!call_user_func_array($this->validationCallback, [$input, &$messages])) {
            if ($this->messageId) {
                $messages[] = new Message($this->messageId, $this->messageParameters);
            }
        }
    }
573095
protected function _error($message) {
		if (count($this->_errors) >= 200) {
			array_shift($this->_errors);
		}
		array_push($this->_errors, $message);
	}
200444
public function error($message, array $context = [])
    {
        $this->checkInitialized();

        foreach ($this->loggers as $logger) {
            $logger->error($message, $context);
        }
    }
1334539
private static function addError($message): void
    {
        if (self::$result === false) {
            self::$result = array();
        }
        self::$result[] = $message;
    }
194653
public function setError(?string $message = null) : void
    {
        $this->is_valid = false;
        $this->error = (null === $message) ? $this->default_error : $message;
    }
1243022
public function setHTMLMessage($message)
    {
        if ($message === '') {
            throw new \InvalidArgumentException('$message must not be empty.', 1331488845);
        }

        if ($this->hasCssFile()) {
            $this->loadEmogrifierClass();
            $emogrifier = new Emogrifier($message, $this->getCssFile());
            $messageToStore = $emogrifier->emogrify();
        } else {
            $messageToStore = $message;
        }

        $this->setAsString('html_message', $messageToStore);
    }