Skip to content

Commit

Permalink
Return the false returned by parent::getLastErrors() as default error…
Browse files Browse the repository at this point in the history
…s array
  • Loading branch information
zonuexe committed Apr 19, 2023
1 parent 9520de8 commit 21364df
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 21364df

Please sign in to comment.