fix: update test for DateTime parse errors to work in php8.2
check if getLastErrors() returns a false bool, rather than specific array elements, as this throws an error in php8.2 if there are no errors returned.
This commit is contained in:
committed by
Frédéric Guillot
parent
3824e6e9aa
commit
32667285a8
@@ -35,7 +35,8 @@ class Date extends Base
|
||||
|
||||
if ($date !== false) {
|
||||
$errors = DateTime::getLastErrors();
|
||||
if ($errors['error_count'] === 0 && $errors['warning_count'] === 0) {
|
||||
if ($errors === false ||
|
||||
$errors['error_count'] === 0 && $errors['warning_count'] === 0) {
|
||||
return $date->getTimestamp() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user