Sirius\Validation\RuleFactory::setMessages PHP Method

setMessages() public method

Set default error message for a rule
public setMessages ( string $rule, string | null $messageWithoutLabel = null, string | null $messageWithLabel = null )
$rule string
$messageWithoutLabel string | null
$messageWithLabel string | null
    public function setMessages($rule, $messageWithoutLabel = null, $messageWithLabel = null)
    {
        if ($messageWithoutLabel) {
            $this->errorMessages[$rule] = $messageWithoutLabel;
        }
        if ($messageWithLabel) {
            $this->labeledErrorMessages[$rule] = $messageWithLabel;
        }
        return $this;
    }