Issue #3349507 by acbramley: DateTimePlus::createFromDateTime should accept DateTimeInterface

merge-requests/3778/head
catch 2023-04-04 09:47:39 +01:00
parent 5187257030
commit f56f349448
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}