mirror of
https://github.com/Respect/Validation.git
synced 2024-06-08 08:42:15 +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 = [
|
protected $defaultTemplates = [
|
||||||
self::MODE_DEFAULT => [
|
self::MODE_DEFAULT => [
|
||||||
self::STANDARD => '{{name}} is not considered as "False"',
|
self::STANDARD => '{{name}} must evaluate to `false`',
|
||||||
],
|
],
|
||||||
self::MODE_NEGATIVE => [
|
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 = [
|
protected $defaultTemplates = [
|
||||||
self::MODE_DEFAULT => [
|
self::MODE_DEFAULT => [
|
||||||
self::STANDARD => '{{name}} is not considered as "No"',
|
self::STANDARD => '{{name}} must be similar to "No"',
|
||||||
],
|
],
|
||||||
self::MODE_NEGATIVE => [
|
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 = [
|
protected $defaultTemplates = [
|
||||||
self::MODE_DEFAULT => [
|
self::MODE_DEFAULT => [
|
||||||
self::STANDARD => '{{name}} is not considered as "True"',
|
self::STANDARD => '{{name}} must evaluate to `true`',
|
||||||
],
|
],
|
||||||
self::MODE_NEGATIVE => [
|
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 = [
|
protected $defaultTemplates = [
|
||||||
self::MODE_DEFAULT => [
|
self::MODE_DEFAULT => [
|
||||||
self::STANDARD => '{{name}} is not considered as "Yes"',
|
self::STANDARD => '{{name}} must be similar to "Yes"',
|
||||||
],
|
],
|
||||||
self::MODE_NEGATIVE => [
|
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--
|
--EXPECT--
|
||||||
`TRUE` is not considered as "False"
|
`TRUE` must evaluate to `false`
|
||||||
"false" is considered as "False"
|
"false" must not evaluate to `false`
|
||||||
- 1 is not considered as "False"
|
- 1 must evaluate to `false`
|
||||||
- 0 is considered as "False"
|
- 0 must not evaluate to `false`
|
||||||
|
|
|
@ -36,7 +36,7 @@ try {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
"No" is considered as "No"
|
"No" must not be similar to "No"
|
||||||
"Yes" is not considered as "No"
|
"Yes" must be similar to "No"
|
||||||
- "No" is considered as "No"
|
- "No" must not be similar to "No"
|
||||||
- "Yes" is not considered as "No"
|
- "Yes" must be similar to "No"
|
||||||
|
|
|
@ -36,7 +36,7 @@ try {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
`FALSE` is not considered as "True"
|
`FALSE` must evaluate to `true`
|
||||||
1 is considered as "True"
|
1 must not evaluate to `true`
|
||||||
- 0 is not considered as "True"
|
- 0 must evaluate to `true`
|
||||||
- "true" is considered as "True"
|
- "true" must not evaluate to `true`
|
||||||
|
|
|
@ -36,7 +36,7 @@ try {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
"Yes" is considered as "Yes"
|
"Yes" must not be similar to "Yes"
|
||||||
"si" is not considered as "Yes"
|
"si" must be similar to "Yes"
|
||||||
- "Yes" is considered as "Yes"
|
- "Yes" must not be similar to "Yes"
|
||||||
- "si" is not considered as "Yes"
|
- "si" must be similar to "Yes"
|
||||||
|
|
Loading…
Reference in a new issue