diff vendor/zendframework/zend-feed/src/Writer/Entry.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
line wrap: on
line diff
--- a/vendor/zendframework/zend-feed/src/Writer/Entry.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/zendframework/zend-feed/src/Writer/Entry.php	Thu Feb 28 13:21:36 2019 +0000
@@ -10,6 +10,7 @@
 namespace Zend\Feed\Writer;
 
 use DateTime;
+use DateTimeInterface;
 use Zend\Feed\Uri;
 
 /**
@@ -178,7 +179,7 @@
     /**
      * Set the feed creation date
      *
-     * @param null|int|DateTime $date
+     * @param null|int|DateTimeInterface $date
      * @throws Exception\InvalidArgumentException
      * @return Entry
      */
@@ -186,9 +187,11 @@
     {
         if ($date === null) {
             $date = new DateTime();
-        } elseif (is_int($date)) {
+        }
+        if (is_int($date)) {
             $date = new DateTime('@' . $date);
-        } elseif (! $date instanceof DateTime) {
+        }
+        if (! $date instanceof DateTimeInterface) {
             throw new Exception\InvalidArgumentException(
                 'Invalid DateTime object or UNIX Timestamp passed as parameter'
             );
@@ -201,7 +204,7 @@
     /**
      * Set the feed modification date
      *
-     * @param null|int|DateTime $date
+     * @param null|int|DateTimeInterface $date
      * @throws Exception\InvalidArgumentException
      * @return Entry
      */
@@ -209,9 +212,11 @@
     {
         if ($date === null) {
             $date = new DateTime();
-        } elseif (is_int($date)) {
+        }
+        if (is_int($date)) {
             $date = new DateTime('@' . $date);
-        } elseif (! $date instanceof DateTime) {
+        }
+        if (! $date instanceof DateTimeInterface) {
             throw new Exception\InvalidArgumentException(
                 'Invalid DateTime object or UNIX Timestamp passed as parameter'
             );