From f56f349448c458c0cb3891f637845835dbd76f2d Mon Sep 17 00:00:00 2001 From: catch Date: Tue, 4 Apr 2023 09:47:39 +0100 Subject: [PATCH] Issue #3349507 by acbramley: DateTimePlus::createFromDateTime should accept DateTimeInterface --- core/lib/Drupal/Component/Datetime/DateTimePlus.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php index 952b6cb6dc2..44d27d89598 100644 --- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php +++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php @@ -126,7 +126,7 @@ class DateTimePlus { /** * Creates a date object from an input date object. * - * @param \DateTime $datetime + * @param \DateTimeInterface $datetime * A DateTime object. * @param array $settings * (optional) A keyed array for settings, suitable for passing on to @@ -135,7 +135,7 @@ class DateTimePlus { * @return static * A new DateTimePlus object. */ - public static function createFromDateTime(\DateTime $datetime, $settings = []) { + public static function createFromDateTime(\DateTimeInterface $datetime, $settings = []) { return new static($datetime->format(static::FORMAT), $datetime->getTimezone(), $settings); }