`DateTime::getLastErrors()` can be false
MODIFY
src/Date.php
src/Date.php
@@ -207,6 +207,10 @@ class Date extends AbstractValidator
// Invalid dates can show up as warnings (ie. "2007-02-99")
// and still return a DateTime object.
$errors = DateTime::getLastErrors();
+ if ($errors === false) {
+ return $date;
+ }
+
if ($errors['warning_count'] > 0) {
if ($addErrors) {
$this->error(self::FALSEFORMAT);

`DateTime::getLastErrors()` can be false

Signed-off-by: George Steel <george@net-glue.co.uk>