mirror of
https://github.com/Respect/Validation.git
synced 2024-06-04 06:42:22 +02:00
Remove "Key" prefix from KeyException message
Most Validation errors are sent to Users/Visitors or Clients and as such might not need to know it was a Key their inputs are being validated upon. Co-authored-by: Henrique Moody <henriquemoody@gmail.com> Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
8b2819e9f8
commit
029fa7fe73
|
@ -30,12 +30,12 @@ final class KeyException extends NestedValidationException implements NonOmissib
|
|||
*/
|
||||
protected $defaultTemplates = [
|
||||
self::MODE_DEFAULT => [
|
||||
self::NOT_PRESENT => 'Key {{name}} must be present',
|
||||
self::INVALID => 'Key {{name}} must be valid',
|
||||
self::NOT_PRESENT => '{{name}} must be present',
|
||||
self::INVALID => '{{name}} must be valid',
|
||||
],
|
||||
self::MODE_NEGATIVE => [
|
||||
self::NOT_PRESENT => 'Key {{name}} must not be present',
|
||||
self::INVALID => 'Key {{name}} must not be valid',
|
||||
self::NOT_PRESENT => '{{name}} must not be present',
|
||||
self::INVALID => '{{name}} must not be valid',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -49,11 +49,11 @@ try {
|
|||
- All of the required rules must pass for the given data
|
||||
- All of the required rules must pass for mysql
|
||||
- host must be of type string
|
||||
- Key user must be present
|
||||
- Key password must be present
|
||||
- user must be present
|
||||
- password must be present
|
||||
- schema must be of type string
|
||||
- All of the required rules must pass for postgresql
|
||||
- Key host must be present
|
||||
- host must be present
|
||||
- user must be of type string
|
||||
- password must be of type string
|
||||
- Key schema must be present
|
||||
- schema must be present
|
||||
|
|
|
@ -50,17 +50,17 @@ Array
|
|||
[mysql] => Array
|
||||
(
|
||||
[host] => host must be of type string
|
||||
[user] => Key user must be present
|
||||
[password] => Key password must be present
|
||||
[user] => user must be present
|
||||
[password] => password must be present
|
||||
[schema] => schema must be of type string
|
||||
)
|
||||
|
||||
[postgresql] => Array
|
||||
(
|
||||
[host] => Key host must be present
|
||||
[host] => host must be present
|
||||
[user] => user must be of type string
|
||||
[password] => password must be of type string
|
||||
[schema] => Key schema must be present
|
||||
[schema] => schema must be present
|
||||
)
|
||||
|
||||
)
|
||||
|
|
|
@ -37,5 +37,5 @@ Array
|
|||
[username] => username must have a length between 2 and 32
|
||||
[birthdate] => birthdate must be a valid date/time
|
||||
[password] => password must not be empty
|
||||
[email] => Key email must be present
|
||||
[email] => email must be present
|
||||
)
|
||||
|
|
|
@ -60,13 +60,13 @@ Array
|
|||
(
|
||||
[host] => 42 should be a MySQL host
|
||||
[user] => Value should be a MySQL username
|
||||
[password] => Key password must be present
|
||||
[password] => password must be present
|
||||
[schema] => schema must be of type string
|
||||
)
|
||||
|
||||
[postgresql] => Array
|
||||
(
|
||||
[host] => Key host must be present
|
||||
[host] => host must be present
|
||||
[user] => user must be of type string
|
||||
[password] => password must be of type string
|
||||
[schema] => You must provide a valid PostgreSQL schema
|
||||
|
|
|
@ -18,5 +18,5 @@ try {
|
|||
--EXPECTF--
|
||||
Array
|
||||
(
|
||||
[First Name] => Key First Name must be present
|
||||
[First Name] => First Name must be present
|
||||
)
|
||||
|
|
|
@ -32,4 +32,4 @@ try {
|
|||
--EXPECT--
|
||||
- These rules must pass for Settings
|
||||
- host must be of type string
|
||||
- Key user must be present
|
||||
- user must be present
|
||||
|
|
|
@ -30,6 +30,6 @@ try {
|
|||
?>
|
||||
--EXPECT--
|
||||
- These rules must pass for `{ "age": 1 }`
|
||||
- Key reference must be present
|
||||
- reference must be present
|
||||
- These rules must pass for `{ "reference": "QSF1234" }`
|
||||
- Key age must be present
|
||||
- age must be present
|
||||
|
|
Loading…
Reference in a new issue