diff vendor/zendframework/zend-feed/src/Writer/AbstractFeed.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/AbstractFeed.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/zendframework/zend-feed/src/Writer/AbstractFeed.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;
 use Zend\Validator;
 
@@ -128,7 +129,7 @@
     /**
      * Set the feed creation date
      *
-     * @param null|int|DateTime
+     * @param null|int|DateTimeInterface
      * @throws Exception\InvalidArgumentException
      * @return AbstractFeed
      */
@@ -136,9 +137,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');
         }
@@ -150,7 +153,7 @@
     /**
      * Set the feed modification date
      *
-     * @param null|int|DateTime
+     * @param null|int|DateTimeInterface
      * @throws Exception\InvalidArgumentException
      * @return AbstractFeed
      */
@@ -158,9 +161,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');
         }
@@ -172,7 +177,7 @@
     /**
      * Set the feed last-build date. Ignored for Atom 1.0.
      *
-     * @param null|int|DateTime
+     * @param null|int|DateTimeInterface
      * @throws Exception\InvalidArgumentException
      * @return AbstractFeed
      */
@@ -180,9 +185,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');
         }
@@ -564,7 +571,7 @@
     /**
      * Get an array with feed authors
      *
-     * @return array
+     * @return array|null
      */
     public function getAuthors()
     {