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

Commit e8c905c

Browse files
committed
chore: small update
1 parent f3a51e0 commit e8c905c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ require_once 'vendor/autoload.php';
2525
Simple usage looks like:
2626

2727
```php
28+
use ProgrammatorDev\YetAnotherPhpValidator\Validator;
2829

30+
$ageValidator = Validator::notBlank()->greaterThanOrEqual(18);
31+
32+
$ageValidator->validate(16); // returns false
33+
$ageValidator->assert(16, 'Age'); // throws exception: The "Age" value should be greater than or equal to "18", "16" given.
2934
```
3035

3136
## Documentation

src/Rule/Range.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public function assert(mixed $value, string $name): void
4444
}
4545

4646
if (
47-
!Validator
48-
::greaterThan($minConstraint)
47+
!Validator::greaterThan($minConstraint)
4948
->validate($maxConstraint)
5049
) {
5150
throw new UnexpectedValueException(
@@ -54,8 +53,7 @@ public function assert(mixed $value, string $name): void
5453
}
5554

5655
if (
57-
!Validator
58-
::greaterThanOrEqual($minConstraint)
56+
!Validator::greaterThanOrEqual($minConstraint)
5957
->lessThanOrEqual($maxConstraint)
6058
->validate($value)
6159
) {

0 commit comments

Comments
 (0)