diff --git a/lib/DateTimeAccessor.php b/lib/DateTimeAccessor.php index aba9666..7769866 100644 --- a/lib/DateTimeAccessor.php +++ b/lib/DateTimeAccessor.php @@ -31,14 +31,14 @@ class DateTimeAccessor { /** - * @var \DateTime + * @var \DateTimeInterface */ private $datetime; /** - * @param \DateTime $datetime + * @param \DateTimeInterface $datetime */ - public function __construct(\DateTime $datetime) + public function __construct(\DateTimeInterface $datetime) { $this->datetime = $datetime; } diff --git a/lib/DateTimeFormatter.php b/lib/DateTimeFormatter.php index 09269c2..efe4949 100644 --- a/lib/DateTimeFormatter.php +++ b/lib/DateTimeFormatter.php @@ -191,7 +191,7 @@ public function __invoke($datetime, $pattern_or_width_or_skeleton) * echo $datetime_formatter($datetime, ':Ehm'); // Sat 10:23 PM * * - * @param \DateTime|string|int $datetime The datetime to format. + * @param \DateTimeInterface|string|int $datetime The datetime to format. * @param string $pattern_or_width_or_skeleton The datetime can be formatted using a pattern, * a width or a skeleton. The following width are defined: "full", "long", "medium" and "short". * To format the datetime using a so-called "skeleton", the skeleton identifier must be diff --git a/lib/Territory.php b/lib/Territory.php index 8f6c6b2..f16aa69 100644 --- a/lib/Territory.php +++ b/lib/Territory.php @@ -109,7 +109,7 @@ protected function lazy_get_currency() /** * Return the currency used in the territory at a point in time. * - * @param \DateTime|mixed $date + * @param \DateTimeInterface|mixed $date * * @return Currency */ @@ -290,13 +290,13 @@ public function localize($locale_code) } /** - * @param \DateTime|string $datetime + * @param \DateTimeInterface|string $datetime * - * @return \DateTime + * @return \DateTimeInterface */ private function ensure_is_datetime($datetime) { - return $datetime instanceof \DateTime + return $datetime instanceof \DateTimeInterface ? $datetime : new \DateTime($datetime); }