Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f48b9eb

Browse files
committed
chore: removed "givens" from error messages
1 parent 0aec7ad commit f48b9eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+95
-95
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $validator = Validator::type('int')->greaterThanOrEqual(18);
3030

3131
// and validate with these:
3232
$validator->validate(16); // returns bool: false
33-
$validator->assert(16, 'age'); // throws exception: The age value should be greater than or equal to 18, 16 given.
33+
$validator->assert(16, 'age'); // throws exception: The age value should be greater than or equal to 18.
3434
```
3535

3636
## Documentation

docs/01-get-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ $validator = Validator::type('int')->greaterThanOrEqual(18);
2828

2929
// and validate with these:
3030
$validator->validate(16); // returns bool: false
31-
$validator->assert(16, 'age'); // throws exception: The age value should be greater than or equal to 18, 16 given.
31+
$validator->assert(16, 'age'); // throws exception: The age value should be greater than or equal to 18.
3232
```

docs/03-rules_blank.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Validator::blank(normalizer: fn($value) => trim($value))->validate(' '); // true
4040

4141
### `message`
4242

43-
type: `?string` default: `The {{ name }} value should be blank, {{ value }} given.`
43+
type: `?string` default: `The {{ name }} value should be blank.`
4444

4545
Message that will be shown if the value is not blank.
4646

docs/03-rules_choice.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ For example, if `max` is 2, the input array must have at most 2 values.
7878

7979
### `message`
8080

81-
type: `?string` default: `The {{ name }} value is not a valid choice, {{ value }} given. Accepted values are: {{ constraints }}.`
81+
type: `?string` default: `The {{ name }} value is not a valid choice. Accepted values are: {{ constraints }}.`
8282

8383
Message that will be shown if input value is not a valid choice.
8484

@@ -92,7 +92,7 @@ The following parameters are available:
9292

9393
### `multipleMessage`
9494

95-
type: `?string` default: `The {{ name }} value has one or more invalid choices, {{ value }} given. Accepted values are: {{ constraints }}.`
95+
type: `?string` default: `The {{ name }} value has one or more invalid choices. Accepted values are: {{ constraints }}.`
9696

9797
Message that will be shown when `multiple` is `true` and at least one of the input array values is not a valid choice.
9898

@@ -106,7 +106,7 @@ The following parameters are available:
106106

107107
### `minMessage`
108108

109-
type: `?string` default: `The {{ name }} value must have at least {{ min }} choices, {{ numElements }} choices given.`
109+
type: `?string` default: `The {{ name }} value must have at least {{ min }} choices.`
110110

111111
Message that will be shown when `multiple` is `true` and input array has fewer values than the defined in `min`.
112112

@@ -123,7 +123,7 @@ The following parameters are available:
123123

124124
### `maxMessage`
125125

126-
type: `?string` default: `The {{ name }} value must have at most {{ max }} choices, {{ numElements }} choices given.`
126+
type: `?string` default: `The {{ name }} value must have at most {{ max }} choices.`
127127

128128
Message that will be shown when `multiple` is `true` and input array has more values than the defined in `max`.
129129

docs/03-rules_count.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ It defines the maximum number of elements required.
5454

5555
### `minMessage`
5656

57-
type: `?string` default: `The {{ name }} value should contain {{ min }} elements or more, {{ numElements }} elements given.`
57+
type: `?string` default: `The {{ name }} value should contain {{ min }} elements or more.`
5858

5959
Message that will be shown when the input value has fewer elements than the defined in `min`.
6060

@@ -70,7 +70,7 @@ The following parameters are available:
7070

7171
### `maxMessage`
7272

73-
type: `?string` default: `The {{ name }} value should contain {{ max }} elements or less, {{ numElements }} elements given.`
73+
type: `?string` default: `The {{ name }} value should contain {{ max }} elements or less.`
7474

7575
Message that will be shown when the input value has more elements than the defined in `max`.
7676

@@ -86,7 +86,7 @@ The following parameters are available:
8686

8787
### `exactMessage`
8888

89-
type: `?string` default: `The {{ name }} value should contain exactly {{ min }} elements, {{ numElements }} elements given.`
89+
type: `?string` default: `The {{ name }} value should contain exactly {{ min }} elements.`
9090

9191
Message that will be shown when `min` and `max` options have the same value and the input value has a different number of elements.
9292

docs/03-rules_country.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Available options:
4141

4242
### `message`
4343

44-
type: `?string` default: `The {{ name }} value is not a valid country, {{ value }} given.`
44+
type: `?string` default: `The {{ name }} value is not a valid country.`
4545

4646
Message that will be shown if the input value is not a valid country code.
4747

docs/03-rules_each-key.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type: `?string` default: `Invalid key: {{ message }}`
3939
Message that will be shown if at least one input value key is invalid according to the given `validator`.
4040

4141
```php
42-
// Throws: Invalid key: The color key value should be of type "string", 1 given.
42+
// throws: Invalid key: The color key value should be of type "string", 1 given.
4343
Validator::eachKey(
4444
Validator::type('string')
4545
)->assert(['red' => '#f00', 1 => '#0f0'], 'color');

docs/03-rules_each-value.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type: `?string` default: `At key "{{ key }}": {{ message }}`
3939
Message that will be shown if at least one input value element is invalid according to the given `validator`.
4040

4141
```php
42-
// Throws: At key 2: The color value should not be blank, "" given.
42+
// throws: At key 2: The color value should not be blank.
4343
Validator::eachValue(
4444
Validator::notBlank()
4545
)->assert(['red', 'green', ''], 'color');

docs/03-rules_email.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Validator::email(normalizer: fn($value) => trim($value))->validate('test@example
5656

5757
### `message`
5858

59-
type: `?string` default: `The {{ name }} value is not a valid email address, {{ value }} given.`
59+
type: `?string` default: `The {{ name }} value is not a valid email address.`
6060

6161
Message that will be shown if the input value is not a valid email address.
6262

docs/03-rules_greater-than-or-equal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Can be a `string`, `int`, `float` or `DateTimeInterface` object.
4444

4545
### `message`
4646

47-
type: `?string` default: `The {{ name }} value should be greater than or equal to {{ constraint }}, {{ value }} given.`
47+
type: `?string` default: `The {{ name }} value should be greater than or equal to {{ constraint }}.`
4848

4949
Message that will be shown if the value is not greater than or equal to the constraint value.
5050

0 commit comments

Comments
 (0)