Commit f56f3494 authored by catch's avatar catch
Browse files

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

parent 51872570
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
  }