Skip to content

Commit

Permalink
Update AntonDate.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ottosmops committed Apr 4, 2024
1 parent e9c2b32 commit 35b0bcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ValueObjects/AntonDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ final class AntonDate implements ValueObjectInterface
/**
* Returns a new AntonDate from a date-string
*
* @param string|integer|null|AntonDate|DateTimeImmutable $sDate in AntonDateFormat 'Y-m-d', 'Y-m', 'Y' or '0000'
* @param string|int|null|AntonDate|DateTimeImmutable $sDate in AntonDateFormat 'Y-m-d', 'Y-m', 'Y' or '0000'
* with or wthout a 'ca. ' in front of the date
* @param bool|int $ca if $sDate starts with 'ca. ' or $ca is true the AntonDate contains $ca == 1
*
* @return static
*/
public static function createFromString(string|AntonDate|DateTimeImmutable|null $sDate, bool|int $ca = 0) : static
public static function createFromString(string|int|null|AntonDate|DateTimeImmutable $sDate, bool|int $ca = 0) : static
{
if ($sDate instanceof AntonDate) {
return $sDate;
Expand All @@ -49,7 +49,7 @@ public static function createFromString(string|AntonDate|DateTimeImmutable|null
return static::createFromString($sDate->format('Y-m-d'));
}
if (is_int($sDate)) {
$sDate = (string) $sDate;
return static::createFromString((string) $sDate);
}

$sDate = $sDate ?: '0000-00-00';
Expand Down

0 comments on commit 35b0bcb

Please sign in to comment.