diff --git a/src/Traits/FactoryTrait.php b/src/Traits/FactoryTrait.php index b962c6af..7fe1b78c 100644 --- a/src/Traits/FactoryTrait.php +++ b/src/Traits/FactoryTrait.php @@ -358,7 +358,12 @@ protected static function safeCreateDateTimeZone($object): DateTimeZone public static function getLastErrors(): array { if (empty(static::$_lastErrors)) { - return parent::getLastErrors(); + return parent::getLastErrors() ?: [ + 'warning_count' => 0, + 'warnings' => [], + 'error_count' => 0, + 'errors' => [], + ]; } return static::$_lastErrors;