mirror of
https://github.com/Respect/Validation.git
synced 2024-06-07 16:22:16 +02:00
Fix wrong templates
The "MinimumAge" exception should use the "{{ name }}" placeholder instead of the "{{ input }}" once that one can be either the input or a user-defined name. In the default message, the placeholder was using sprintf format, but the correct way is to use "{{name}}". Also use the same style of the other messages in the default message. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
0e81792ec8
commit
aa4b111c90
|
@ -24,10 +24,10 @@ final class MinimumAgeException extends ValidationException
|
|||
*/
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{input}} must be {{age}} years or more',
|
||||
self::STANDARD => '{{name}} must be {{age}} years or more',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => '{{input}} must not be {{age}} years or more',
|
||||
self::STANDARD => '{{name}} must not be {{age}} years or more',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -25,10 +25,10 @@ class ValidationException extends InvalidArgumentException implements ExceptionI
|
|||
const STANDARD = 0;
|
||||
public static $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => 'Data validation failed for %s',
|
||||
self::STANDARD => '{{name}} must be valid',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => 'Data validation failed for %s',
|
||||
self::STANDARD => '{{name}} must not be valid',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue