mirror of
https://github.com/Respect/Validation.git
synced 2024-05-17 21:56:40 +02:00
Standardize exception messages
Most exception messages in Validation use "must" and "must not" in their templates, but a few rules don't. I fixed most of them, but AlwaysValid and AlwaysInvalid remain because I wonder if they will be better if I update them. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
830ad97126
commit
003830b8e9
|
@ -20,10 +20,10 @@ final class FalseValException extends ValidationException
|
|||
*/
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "False"',
|
||||
self::STANDARD => '{{name}} must evaluate to `false`',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => '{{name}} is considered as "False"',
|
||||
self::STANDARD => '{{name}} must not evaluate to `false`',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@ final class NoException extends ValidationException
|
|||
*/
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "No"',
|
||||
self::STANDARD => '{{name}} must be similar to "No"',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => '{{name}} is considered as "No"',
|
||||
self::STANDARD => '{{name}} must not be similar to "No"',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ final class TrueValException extends ValidationException
|
|||
*/
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "True"',
|
||||
self::STANDARD => '{{name}} must evaluate to `true`',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => '{{name}} is considered as "True"',
|
||||
self::STANDARD => '{{name}} must not evaluate to `true`',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -20,10 +20,10 @@ final class YesException extends ValidationException
|
|||
*/
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::STANDARD => '{{name}} is not considered as "Yes"',
|
||||
self::STANDARD => '{{name}} must be similar to "Yes"',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::STANDARD => '{{name}} is considered as "Yes"',
|
||||
self::STANDARD => '{{name}} must not be similar to "Yes"',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ try {
|
|||
|
||||
?>
|
||||
--EXPECT--
|
||||
`TRUE` is not considered as "False"
|
||||
"false" is considered as "False"
|
||||
- 1 is not considered as "False"
|
||||
- 0 is considered as "False"
|
||||
`TRUE` must evaluate to `false`
|
||||
"false" must not evaluate to `false`
|
||||
- 1 must evaluate to `false`
|
||||
- 0 must not evaluate to `false`
|
||||
|
|
|
@ -36,7 +36,7 @@ try {
|
|||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
"No" is considered as "No"
|
||||
"Yes" is not considered as "No"
|
||||
- "No" is considered as "No"
|
||||
- "Yes" is not considered as "No"
|
||||
"No" must not be similar to "No"
|
||||
"Yes" must be similar to "No"
|
||||
- "No" must not be similar to "No"
|
||||
- "Yes" must be similar to "No"
|
||||
|
|
|
@ -36,7 +36,7 @@ try {
|
|||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
`FALSE` is not considered as "True"
|
||||
1 is considered as "True"
|
||||
- 0 is not considered as "True"
|
||||
- "true" is considered as "True"
|
||||
`FALSE` must evaluate to `true`
|
||||
1 must not evaluate to `true`
|
||||
- 0 must evaluate to `true`
|
||||
- "true" must not evaluate to `true`
|
||||
|
|
|
@ -36,7 +36,7 @@ try {
|
|||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
"Yes" is considered as "Yes"
|
||||
"si" is not considered as "Yes"
|
||||
- "Yes" is considered as "Yes"
|
||||
- "si" is not considered as "Yes"
|
||||
"Yes" must not be similar to "Yes"
|
||||
"si" must be similar to "Yes"
|
||||
- "Yes" must not be similar to "Yes"
|
||||
- "si" must be similar to "Yes"
|
||||
|
|
Loading…
Reference in a new issue