/** * Check if a message passes a specific test, and return a status that identifies if it is or isn't. * * @param Message $message */ public function validate(Message $message) { if ($message->hasTitleAFullStop()) { $message->addStatus(new DoNotEndTheSubjectLineWithAPeriodStatus()); } }
/** * Check if a message passes a specific test, and return a status that identifies if it is or isn't. * * @param Message $message */ public function validate(Message $message) { if ($message->getTitleLength() > self::CHARACTER_LIMIT) { $message->addStatus(new LimitTheTitleLengthTo69CharactersStatus()); } }
/** * Check if a message passes a specific test, and return a status that identifies if it is or isn't. * * @param Message $message */ public function validate(Message $message) { if (!$message->hasBlankLineAfterTitle()) { $message->addStatus(new SeparateSubjectFromBodyWithABlankLineStatus()); } }
/** * Check if a message passes a specific test, and return a status that identifies if it is or isn't. * * @param Message $message */ public function validate(Message $message) { if ($message->getBodyWrapLength() > self::WRAP_LIMIT) { $message->addStatus(new LimitTheBodyWrapLengthTo72CharactersStatus()); } }
/** * Check if a message passes a specific test, and return a status that identifies if it is or isn't. * * @param Message $message */ public function validate(Message $message) { if (!$message->isTitleCapitalised()) { $message->addStatus(new CapitalizeTheSubjectLineStatus()); } }