Skip to content

Commit

Permalink
Fix possible value conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
YOzaz committed Feb 11, 2024
1 parent 4be0c00 commit c4f1f57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Carbon/Carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ public function __construct($time = null, $tz = null)
if (isset($locale)) {
setlocale(LC_NUMERIC, $locale);
}
static::setLastErrors(parent::getLastErrors());
static::setLastErrors((array)parent::getLastErrors());
}

/**
Expand Down Expand Up @@ -884,7 +884,7 @@ public static function createFromFormat($format, $time, $tz = null)
{
// First attempt to create an instance, so that error messages are based on the unmodified format.
$date = self::createFromFormatAndTimezone($format, $time, $tz);
$lastErrors = parent::getLastErrors();
$lastErrors = (array)parent::getLastErrors();

if (($mock = static::getTestNow()) && ($date instanceof DateTime || $date instanceof DateTimeInterface)) {
// Set timezone from mock if custom timezone was neither given directly nor as a part of format.
Expand Down

0 comments on commit c4f1f57

Please sign in to comment.