Skip to content

Commit b8f4919

Browse files
authored
Merge pull request #57 from programmatordev/1.x
1.x
2 parents 5c60a11 + 03d51cf commit b8f4919

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php-http/client-common": "^2.7",
1818
"php-http/discovery": "^1.18",
1919
"php-http/logger-plugin": "^1.3",
20-
"programmatordev/yet-another-php-validator": "^0.4",
20+
"programmatordev/yet-another-php-validator": "^0.5",
2121
"psr/cache": "^2.0 || ^3.0",
2222
"psr/http-client": "^1.0",
2323
"psr/http-factory": "^1.0",

docs/04-error-handling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484
}
8585
catch (ValidationException $exception) {
8686
// Should print:
87-
// The "latitude" value should be between "-90" and "90", "999" given.
87+
// The latitude value should be between -90 and 90, 999 given.
8888
echo $exception->getMessage();
8989
}
9090
```

src/Endpoint/Util/ValidationTrait.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ private function validateDateRange(\DateTimeInterface $startDate, \DateTimeInter
2727
// Start date must be less or equal to end date
2828
Validator::lessThanOrEqual(
2929
constraint: $endDate,
30-
message: 'The "{{ name }}" value should be less than or equal to the "endDate"'
31-
)->assert($startDate, 'startDate');
30+
message: 'The startDate value should be less than or equal to the endDate.'
31+
)->assert($startDate);
3232

3333
// End date must be less or equal to today date
34-
Validator::lessThanOrEqual(
35-
constraint: $nowDate
36-
)->assert($endDate, 'endDate');
34+
Validator::lessThanOrEqual($nowDate)->assert($endDate, 'endDate');
3735
}
3836

3937
/**

0 commit comments

Comments
 (0)