Skip to content

Commit

Permalink
Merge pull request #57 from programmatordev/1.x
Browse files Browse the repository at this point in the history
1.x
  • Loading branch information
andrepimpao committed Nov 6, 2023
2 parents 5c60a11 + 03d51cf commit b8f4919
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"php-http/client-common": "^2.7",
"php-http/discovery": "^1.18",
"php-http/logger-plugin": "^1.3",
"programmatordev/yet-another-php-validator": "^0.4",
"programmatordev/yet-another-php-validator": "^0.5",
"psr/cache": "^2.0 || ^3.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/04-error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ try {
}
catch (ValidationException $exception) {
// Should print:
// The "latitude" value should be between "-90" and "90", "999" given.
// The latitude value should be between -90 and 90, 999 given.
echo $exception->getMessage();
}
```
8 changes: 3 additions & 5 deletions src/Endpoint/Util/ValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ private function validateDateRange(\DateTimeInterface $startDate, \DateTimeInter
// Start date must be less or equal to end date
Validator::lessThanOrEqual(
constraint: $endDate,
message: 'The "{{ name }}" value should be less than or equal to the "endDate"'
)->assert($startDate, 'startDate');
message: 'The startDate value should be less than or equal to the endDate.'
)->assert($startDate);

// End date must be less or equal to today date
Validator::lessThanOrEqual(
constraint: $nowDate
)->assert($endDate, 'endDate');
Validator::lessThanOrEqual($nowDate)->assert($endDate, 'endDate');
}

/**
Expand Down

0 comments on commit b8f4919

Please sign in to comment.