Skip to content

Commit 91caf42

Browse files
authored
fix: allow returning any CarbonInterface from asDateTime
1 parent 3f8ce6c commit 91caf42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Concerns/HasCasts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,15 @@ protected function asTimestamp(mixed $value): int
344344
/**
345345
* Return a timestamp as DateTime object with time set to 00:00:00.
346346
*/
347-
protected function asDate(mixed $value): Carbon
347+
protected function asDate(mixed $value): CarbonInterface
348348
{
349349
return $this->asDateTime($value)->startOfDay();
350350
}
351351

352352
/**
353353
* Return a timestamp as DateTime object.
354354
*/
355-
protected function asDateTime(mixed $value): Carbon
355+
protected function asDateTime(mixed $value): CarbonInterface
356356
{
357357
if ($value instanceof CarbonInterface) {
358358
return Date::instance($value);

0 commit comments

Comments
 (0)