Skip to content

Commit

Permalink
Validator::formatMessage() added validator name to error message (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored and dg committed Jan 19, 2021
1 parent 484793a commit e7328ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Forms/Validator.php
Expand Up @@ -61,7 +61,11 @@ public static function formatMessage(Rule $rule, bool $withValue = true)
$message = static::$messages[$rule->validator];

} elseif ($message == null) { // intentionally ==
trigger_error("Missing validation message for control '{$rule->control->getName()}'.", E_USER_WARNING);
trigger_error(
"Missing validation message for control '{$rule->control->getName()}'"
. (is_string($rule->validator) ? " (validator '{$rule->validator}')." : '.'),
E_USER_WARNING
);
}

if ($translator = $rule->control->getForm()->getTranslator()) {
Expand Down

0 comments on commit e7328ee

Please sign in to comment.