Skip to content

Commit 91debb5

Browse files
committed
Updates constructor to use DateTimeInterface type hint
Replaces the type hint for the constructor parameter from DateTime to DateTimeInterface for improved flexibility and compatibility with different DateTime implementations.
1 parent 4f69df1 commit 91debb5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Ease/Html/Widgets/LiveAge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class LiveAge extends TimeTag
2727
/**
2828
* Show live time to timestamp.
2929
*
30-
* @param \DateTime $dater When to count from
30+
* @param \DateTimeInterface $dater When to count from
3131
* @param array<string, string> $properties TimeTag properties
3232
*/
33-
public function __construct($dater, array $properties = [])
33+
public function __construct(\DateTimeInterface $dater, array $properties = [])
3434
{
3535
$days = $dater->diff(new \DateTime())->days;
3636
$age = ($dater->getTimestamp() - (new \DateTime())->getTimestamp());

0 commit comments

Comments
 (0)