Skip to content

Commit

Permalink
Merge pull request #391 from zonuexe/fix/getLastErrors-returns-false
Browse files Browse the repository at this point in the history
Return the false returned by parent::getLastErrors() as default errors array
  • Loading branch information
othercorey authored Apr 19, 2023
2 parents 9520de8 + 21364df commit b5d962b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Traits/FactoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b5d962b

Please sign in to comment.