Validates a message according to 1.0 standard

@param  MessageInterface $message
@param  string           &$reason reason for the validation fail
@return bool
507529
public function validate0100(MessageInterface $message, &$reason = "")
    {
        if (self::isEmpty($message->getHost())) {
            $reason = "host not set";

            return false;
        }

        if (self::isEmpty($message->getShortMessage())) {
            $reason = "short-message not set";

            return false;
        }

        if (self::isEmpty($message->getVersion())) {
            $reason = "version not set";

            return false;
        }

        if ($message->hasAdditional('id')) {
            $reason = "additional field 'id' is not allowed";

            return false;
        }

        return true;
    }
740589
public function send(MessageInterface $message, $skipErrors = true) {
        $this->clearErrors();

        $command = $this->prepareCommand($message->getText());

        foreach ($message->getRecipient() as $recipient) {
            // execute command
            $command = str_replace('#RECIPIENT#', $recipient, $command);

            $return = 0;
            $output = [];
            exec($command, $output, $return);

            if ($return !== 0) {
                $errorMsg = sprintf("Error while sending message to \"%s\".", $recipient);
                $this->addError(new SendingError($recipient, self::ERROR_NOT_SAVED, $errorMsg));
                if (!$skipErrors) {
                    throw new RuntimeException($errorMsg, self::ERROR_NOT_SAVED);
                }
            }
        }
        return $this->getErrors()->count() === 0;
    }
382998
protected function throwValidationException(string $message, string $prefix = null)
    {
        throw new ValidationException($message, $this->name, $prefix);
    }
861384
function verify($message, $signature)
    {
        if (empty($this->modulus) || empty($this->exponent)) {
            return false;
        }

        switch ($this->signatureMode) {
            case self::SIGNATURE_PKCS1:
                return $this->_rsassa_pkcs1_v1_5_verify($message, $signature);
            //case self::SIGNATURE_PSS:
            default:
                return $this->_rsassa_pss_verify($message, $signature);
        }
    }
1219759
public function send($message = null, $status = null, $reason = null)
	{
		$this->response->setContent($message);
		$this->response->setStatusCode($status ? $status : 200);
	}
1314567
public function validate(BaseModel $model, $rules = null, $messages = [])
    {
        return $this->validateAndPrefixErrors(null, $model, $rules, $messages);
    }
1032909
public function matches(MessageReceived $message): bool
    {
        $haystack = $this->values;

        if ($haystack instanceof Collection) {
            $haystack = $haystack->toArray();
        }

        return in_array($message->getText(), $haystack, false);
    }
1270517
public function setMessage(MessageInterface $message = null): ValidatorRuleInterface
    {
        $this->message = $message ?? $this->setupDefaultMessage();
        
        return $this;
    }
135055
public function setMessage(
        $message,
        $messageType = ValidationResult::TYPE_ERROR,
        $messageCast = ValidationResult::CAST_TEXT
    ) {
        if (!in_array($messageCast, [ValidationResult::CAST_TEXT, ValidationResult::CAST_HTML])) {
            throw new InvalidArgumentException("Invalid message cast type");
        }
        $this->message = $message;
        $this->messageType = $messageType;
        $this->messageCast = $messageCast;
        return $this;
    }
1209416
public function abortIf($condition, $message = '')
    {
        $message = (strlen($message)) ? $message : 'Unknown Reason';

        if (true === $condition) {
            throw new AbortException($message);
        }
    }
1094313
public function validate(Message $message)
    {
        if ($message->getTitleLength() > self::CHARACTER_LIMIT) {
            $message->addStatus(new LimitTheTitleLengthTo69CharactersStatus());
        }
    }
383040
public function warnIf($condition, $message = '')
    {
        $message = (strlen($message)) ? $message : 'Unknown Reason';

        if (true === $condition) {
            $this->outputWriter->write('    <warning>Warning during ' . $this->version->getExecutionState() . ': ' . $message . '</warning>');
        }
    }
241663
protected function isValidMessage($message): Message
    {
        if ($message instanceof Message) {
            return $message;
        }

        if (\is_string($message) || $message instanceof Attachment) {
            return Message::create($message);
        }

        throw new MessengerException(sprintf(
            'message must be a string or an instance of %s or %s.',
            Message::class,
            Attachment::class
        ));
    }
893530
private function messageIsValid(): bool
    {
        if (!$this->message instanceof AbstractMessage) {
            throw new \RuntimeException(\sprintf('Message is not instance of %s', AbstractMessage::class));
        }

        if (!$this->message->getTarget() instanceof Target\TargetInterface) {
            throw new \RuntimeException(\sprintf('Message target is not instance of %s', Target\TargetInterface::class));
        }

        if (!$this->message->getPayload() instanceof CommonPayloadInterface) {
            throw new \RuntimeException(\sprintf('Message target is not instance of %s', CommonPayloadInterface::class));
        }

        return true;
    }
1228387
public static function that($condition, $message = null)
    {
        if ($condition === true) {
            return;
        }
        if (isset($message)) {
            throw new InvalidArgumentException($message);
        }
        $bt = debug_backtrace();
        $call = $bt[0];
        $lines = file($call['file']);
        preg_match('/' . $call['function'] . '\((.+)\)/', $lines[$call['line'] - 1], $matches);
        throw new InvalidArgumentException('Assumption failed: ' . $matches[1]);
    }
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);
            }
        }
    }
235110
public static function set_error_message($rule, $message)
    {
        $gump = self::get_instance();
        self::$validation_methods_errors[$rule] = $message;
    }