Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / zendframework / zend-feed / src / Reader / Extension / Podcast / Feed.php
index d2d11cb4bdffadf0b854a07db7dd21d6bfb55518..987fc6927163353bb8c90e0da039b1f6033eea23 100644 (file)
@@ -1,10 +1,8 @@
 <?php
 /**
- * Zend Framework (http://framework.zend.com/)
- *
- * @link      http://github.com/zendframework/zf2 for the canonical source repository
- * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
- * @license   http://framework.zend.com/license/new-bsd New BSD License
+ * @see       https://github.com/zendframework/zend-feed for the canonical source repository
+ * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
+ * @license   https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
  */
 
 namespace Zend\Feed\Reader\Extension\Podcast;
@@ -12,8 +10,6 @@ namespace Zend\Feed\Reader\Extension\Podcast;
 use DOMText;
 use Zend\Feed\Reader\Extension;
 
-/**
-*/
 class Feed extends Extension\AbstractFeed
 {
     /**
@@ -125,7 +121,7 @@ class Feed extends Extension\AbstractFeed
     }
 
     /**
-     * Get the entry image
+     * Get the feed/podcast image
      *
      * @return string
      */
@@ -149,10 +145,18 @@ class Feed extends Extension\AbstractFeed
     /**
      * Get the entry keywords
      *
+     * @deprecated since 2.10.0; itunes:keywords is no longer part of the
+     *     iTunes podcast RSS specification.
      * @return string
      */
     public function getKeywords()
     {
+        trigger_error(
+            'itunes:keywords has been deprecated in the iTunes podcast RSS specification,'
+            . ' and should not be relied on.',
+            \E_USER_DEPRECATED
+        );
+
         if (isset($this->data['keywords'])) {
             return $this->data['keywords'];
         }
@@ -265,6 +269,51 @@ class Feed extends Extension\AbstractFeed
         return $this->data['summary'];
     }
 
+    /**
+     * Get the type of podcast
+     *
+     * @return string One of "episodic" or "serial". Defaults to "episodic"
+     *     if no itunes:type tag is encountered.
+     */
+    public function getPodcastType()
+    {
+        if (isset($this->data['podcastType'])) {
+            return $this->data['podcastType'];
+        }
+
+        $type = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:type)');
+
+        if (! $type) {
+            $type = 'episodic';
+        }
+
+        $this->data['podcastType'] = (string) $type;
+
+        return $this->data['podcastType'];
+    }
+
+    /**
+     * Is the podcast complete (no more episodes will post)?
+     *
+     * @return bool
+     */
+    public function isComplete()
+    {
+        if (isset($this->data['complete'])) {
+            return $this->data['complete'];
+        }
+
+        $complete = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:complete)');
+
+        if (! $complete) {
+            $complete = false;
+        }
+
+        $this->data['complete'] = $complete === 'Yes';
+
+        return $this->data['complete'];
+    }
+
     /**
      * Register iTunes namespace
      *