Gajus\Vlad\Translator::setValidatorMessage PHP Méthode

setValidatorMessage() public méthode

public setValidatorMessage ( $validator_name, $message )
    public function setValidatorMessage($validator_name, $message)
    {
        if (!is_string($validator_name)) {
            throw new \Gajus\Vlad\Exception\InvalidArgumentException('Validator name must be a string.');
        }
        if (strpos($validator_name, '\\') === false) {
            $validator_name = 'Gajus\\Vlad\\Validator\\' . $validator_name;
        }
        if (!class_exists($validator_name)) {
            throw new \Gajus\Vlad\Exception\InvalidArgumentException('Validator not found.');
        } else {
            if (!is_subclass_of($validator_name, 'Gajus\\Vlad\\Validator')) {
                throw new \Gajus\Vlad\Exception\InvalidArgumentException('Validator must extend Gajus\\Vlad\\Validator.');
            }
        }
        $this->validator_messages[$validator_name] = $message;
    }