forked from Respect/Validation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix casting error in AbstractInterval classes
The classes that are children of "AbstractInterval" convert their values before comparing them. Because PHP tries to convert values when making comparisons and an "DateTime" object cannot be converted to integer or float some validations would result into PHP triggering an error like: > Object of class DateTime could not be converted to int > Object of class DateTime could not be converted to float This commit prevents that to happen by verifying if both compared values are scalar or not before comparing them with each other. Signed-off-by: Henrique Moody <[email protected]>
- Loading branch information
1 parent
4f3aa90
commit 47f2159
Showing
5 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters