Prechádzať zdrojové kódy

Added some CS modifications based on review

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19730 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 rokov pred
rodič
commit
2c72c2266e
23 zmenil súbory, kde vykonal 1189 pridanie a 192 odobranie
  1. 84 77
      documentation/manual/en/module_specs/Zend_Feed_Writer.xml
  2. 19 18
      library/Zend/Feed/Writer.php
  3. 8 3
      library/Zend/Feed/Writer/Entry.php
  4. 28 6
      library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php
  5. 20 5
      library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php
  6. 20 5
      library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php
  7. 20 5
      library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php
  8. 80 9
      library/Zend/Feed/Writer/Extension/ITunes/Entry.php
  9. 115 9
      library/Zend/Feed/Writer/Extension/ITunes/Feed.php
  10. 62 5
      library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php
  11. 90 5
      library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php
  12. 80 4
      library/Zend/Feed/Writer/Extension/RendererAbstract.php
  13. 23 2
      library/Zend/Feed/Writer/Extension/RendererInterface.php
  14. 20 5
      library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php
  15. 34 5
      library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php
  16. 20 5
      library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php
  17. 4 4
      library/Zend/Feed/Writer/Feed.php
  18. 69 4
      library/Zend/Feed/Writer/Renderer/Entry/Atom.php
  19. 76 4
      library/Zend/Feed/Writer/Renderer/Entry/Rss.php
  20. 116 4
      library/Zend/Feed/Writer/Renderer/Feed/Atom.php
  21. 95 4
      library/Zend/Feed/Writer/Renderer/Feed/Rss.php
  22. 71 2
      library/Zend/Feed/Writer/Renderer/RendererAbstract.php
  23. 35 2
      library/Zend/Feed/Writer/Renderer/RendererInterface.php

+ 84 - 77
documentation/manual/en/module_specs/Zend_Feed_Writer.xml

@@ -1,99 +1,107 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Reviewed: no -->
 <sect1 id="zend.feed.writer">
     <title>Zend_Feed_Writer</title>
 
     <sect2 id="zend.feed.writer.introduction">
         <title>Introduction</title>
 
-        <para><classname>Zend_Feed_Writer</classname> is the sibling component to
-        <classname>Zend_Feed_Reader</classname> responsible for generating feeds
-        for output. It supports the Atom 1.0 specification (RFC 4287) and RSS 2.0
-        as specified by the RSS Advisory Board (RSS 2.0.11). It does not deviate
-        from these standards. It does, however, offer a simple Extension system
-        which allows for any extension/module for either of these two specifications
-        to be implemented if they are not provided out of the box.</para>
+        <para>
+            <classname>Zend_Feed_Writer</classname> is the sibling component to
+            <classname>Zend_Feed_Reader</classname> responsible for generating feeds for output. It
+            supports the Atom 1.0 specification (RFC 4287) and RSS 2.0 as specified by the RSS
+            Advisory Board (RSS 2.0.11). It does not deviate from these standards. It does, however,
+            offer a simple Extension system which allows for any extension/module for either of
+            these two specifications to be implemented if they are not provided out of the box.
+        </para>
         
-        <para>In many ways, <classname>Zend_Feed_Writer</classname> is the inverse
-        of <classname>Zend_Feed_Reader</classname>. Where
-        <classname>Zend_Feed_Reader</classname> focused on providing an easy to
-        use architecture fronted by getter methods, <classname>Zend_Feed_Writer</classname>
-        is fronted by similarly named setters or mutators. This ensures the API
-        won't pose a learning curve to anyone familiar with
-        <classname>Zend_Feed_Reader</classname>.</para>
+        <para>
+            In many ways, <classname>Zend_Feed_Writer</classname> is the inverse of
+            <classname>Zend_Feed_Reader</classname>. Where <classname>Zend_Feed_Reader</classname>
+            focused on providing an easy to use architecture fronted by getter methods,
+            <classname>Zend_Feed_Writer</classname> is fronted by similarly named setters or
+            mutators. This ensures the API won't pose a learning curve to anyone familiar with
+            <classname>Zend_Feed_Reader</classname>.
+        </para>
         
-        <para>As a result of this design, the rest may even be obvious. Behind the
-        scenes, data set on any <classname>Zend_Feed_Reader</classname> object is
-        translated at render time onto a <classname>DOMDocument</classname> object
-        using the necessary feed elements. For each supported feed type there is
-        both an Atom 1.0 and RSS 2.0 renderer. Using a <classname>DOMDocument</classname>
-        rather a templating solution has numerous advantages, the most obvious being
-        the ability to export the <classname>DOMDocument</classname> for additional
-        processing and relying on PHP DOM for correct and valid rendering.</para>
+        <para>
+            As a result of this design, the rest may even be obvious. Behind the scenes, data set on
+            any <classname>Zend_Feed_Reader</classname> object is translated at render time onto a
+            <classname>DOMDocument</classname> object using the necessary feed elements. For each
+            supported feed type there is both an Atom 1.0 and RSS 2.0 renderer. Using a
+            <classname>DOMDocument</classname> rather a templating solution has numerous advantages,
+            the most obvious being the ability to export the <classname>DOMDocument</classname> for
+            additional processing and relying on PHP DOM for correct and valid rendering.
+        </para>
         
-        <para>As with <classname>Zend_Feed_Reader</classname>,
-        <classname>Zend_Feed_Writer</classname> is a standalone replacement for
-        <classname>Zend_Feed</classname>'s Builder architecture and is not compatible
-        with those classes.</para>
+        <para>
+            As with <classname>Zend_Feed_Reader</classname>, <classname>Zend_Feed_Writer</classname>
+            is a standalone replacement for <classname>Zend_Feed</classname>'s Builder architecture
+            and is not compatible with those classes.
+        </para>
         
     </sect2>
     
     <sect2 id="zend.feed.writer.architecture">
         <title>Architecture</title>
         
-        <para>The architecture of <classname>Zend_Feed_Writer</classname> is very
-        simple. It has two core sets of classes: containers and renderers.</para>
+        <para>
+            The architecture of <classname>Zend_Feed_Writer</classname> is very simple. It has two
+            core sets of classes: containers and renderers.
+        </para>
         
-        <para>The containers include the <classname>Zend_Feed_Writer_Feed</classname>
-        and <classname>Zend_Feed_Writer_Entry</classname> classes. The Entry classes
-        can be attached to any Feed class. The sole purpose of these containers is
-        to collect data about the feed to generate using a simple interface of setter
-        methods. These methods perform some data validity testing. For example, it
-        will validate any passed URIs, dates, etc. These checks are not tied to any
-        of the feed standards. The container objects also contain methods to allow
-        for fast rendering and export of the final feed, and these can be reused at will.</para>
+        <para>
+            The containers include the <classname>Zend_Feed_Writer_Feed</classname> and
+            <classname>Zend_Feed_Writer_Entry</classname> classes. The Entry classes can be attached
+            to any Feed class. The sole purpose of these containers is to collect data about the
+            feed to generate using a simple interface of setter methods. These methods perform some
+            data validity testing. For example, it will validate any passed URIs, dates, etc. These
+            checks are not tied to any of the feed standards. The container objects also contain
+            methods to allow for fast rendering and export of the final feed, and these can be
+            reused at will.
+        </para>
         
-        <para>While there are two data containers, there are four renderers - two
-        matching container renderers per support feed type. The renderer accept a
-        container, and based on its content attempt to generate a valid feed. If
-        the renderer is unable to generate a valid feed, perhaps due to the container
-        missing an obligatory data point, it will report this by throwing an
-        <classname>Exception</classname>. While it is possible to ignore
-        <classname>Exception</classname>s, this removes the default safeguard of
-        ensuring you have sufficient data set to render a wholly valid feed.</para>
-        
-        <para>Due to the system being divided between data containers and
-        renderers, it can make Extensions somewhat interesting. A typical Extension
-        offering namespaced feed and entry level elements, must itself reflect the
-        exact same architecture, i.e. offer feed and entry level data containers,
-        and matching renderers. There is, fortunately, no complex integration work
-        required since all Extension classes are simply registered and automatically
-        used by the core classes. We'll meet Extensions in more detail at the end
-        of this section.</para>
+        <para>
+            While there are two data containers, there are four renderers - two matching container
+            renderers per support feed type. The renderer accept a container, and based on its
+            content attempt to generate a valid feed. If the renderer is unable to generate a valid
+            feed, perhaps due to the container missing an obligatory data point, it will report this
+            by throwing an <classname>Exception</classname>. While it is possible to ignore
+            <classname>Exception</classname>s, this removes the default safeguard of ensuring you
+            have sufficient data set to render a wholly valid feed.
+        </para>
         
+        <para>
+            Due to the system being divided between data containers and renderers, it can make
+            Extensions somewhat interesting. A typical Extension offering namespaced feed and entry
+            level elements, must itself reflect the exact same architecture, i.e. offer feed and
+            entry level data containers, and matching renderers. There is, fortunately, no complex
+            integration work required since all Extension classes are simply registered and
+            automatically used by the core classes. We'll meet Extensions in more detail at the end
+            of this section.
+        </para>
     </sect2>
     
     <sect2 id="zend.feed.writer.getting.started">
         <title>Getting Started</title>
     
-        <para>Using <classname>Zend_Feed_Reader</classname> is as simple as
-        setting data and triggering the renderer. Here is an example to generate
-        a minimal Atom 1.0 feed.</para>
+        <para>
+            Using <classname>Zend_Feed_Reader</classname> is as simple as setting data and
+            triggering the renderer. Here is an example to generate a minimal Atom 1.0 feed.
+        </para>
         
         <programlisting language="php"><![CDATA[
-require_once 'Zend/Feed/Writer/Feed.php';
-
 /**
  * Create the parent feed
  */
-
 $feed = new Zend_Feed_Writer_Feed;
 $feed->setTitle('Paddy\'s Blog');
 $feed->setLink('http://www.example.com');
 $feed->setFeedLink('http://www.example.com/atom', 'atom');
 $feed->addAuthor(array(
-    'name' => 'Paddy',
+    'name'  => 'Paddy',
     'email' => 'paddy@example.com',
-    'uri' => 'http://www.example.com'
+    'uri'   => 'http://www.example.com',
 ));
 $feed->setDateModified(time());
 $feed->addHub('http://pubsubhubbub.appspot.com/');
@@ -102,14 +110,13 @@ $feed->addHub('http://pubsubhubbub.appspot.com/');
  * Add one or more entries. Note that entries must
  * be manually added once created.
  */
-
 $entry = $feed->createEntry();
 $entry->setTitle('All Your Base Are Belong To Us');
 $entry->setLink('http://www.example.com/all-your-base-are-belong-to-us');
 $entry->addAuthor(array(
-    'name' => 'Paddy',
+    'name'  => 'Paddy',
     'email' => 'paddy@example.com',
-    'uri' => 'http://www.example.com'
+    'uri'   => 'http://www.example.com',
 ));
 $entry->setDateModified(time());
 $entry->setDateCreated(time());
@@ -121,13 +128,14 @@ $feed->addEntry($entry);
  * Render the resulting feed to Atom 1.0 and assign to $out.
  * You can substitute "atom" with "rss" to generate an RSS 2.0 feed.
  */
-
 $out = $feed->export('atom');
 ]]></programlisting>
 
-        <para>The output rendered should be as follows:</para>
+        <para>
+            The output rendered should be as follows:
+        </para>
         
-                <programlisting language="xml">
+        <programlisting language="xml">
 &#60;?xml version="1.0" encoding="utf-8"?&#62;
 &#60;feed xmlns="http://www.w3.org/2005/Atom"&#62;
     &#60;title type="text"&#62;Paddy's Blog&#60;/title&#62;
@@ -166,15 +174,14 @@ $out = $feed->export('atom');
 &#60;/feed&#62;
 </programlisting>
 
-        <para>This is a perfect Atom 1.0 example. It should be noted that omitting
-        an obligatory point of data, such as a title, will trigger an
-        <classname>Exception</classname> when rendering as Atom 1.0. This will
-        differ for RSS 2.0 since a title may be omitted so long as a description
-        is present. This gives rise to Exceptions that differ between the two standards
-        depending on the renderer in use. By design, <classname>Zend_Feed_Writer</classname>
-        will not render an invalid feed for either standard unless the end-user
-        deliberately elects to ignore all Exceptions.</para>
-    
+        <para>
+            This is a perfect Atom 1.0 example. It should be noted that omitting an obligatory point
+            of data, such as a title, will trigger an <classname>Exception</classname> when
+            rendering as Atom 1.0. This will differ for RSS 2.0 since a title may be omitted so long
+            as a description is present. This gives rise to Exceptions that differ between the two
+            standards depending on the renderer in use. By design,
+            <classname>Zend_Feed_Writer</classname> will not render an invalid feed for either
+            standard unless the end-user deliberately elects to ignore all Exceptions.
+        </para>
     </sect2>
-
 </sect1>

+ 19 - 18
library/Zend/Feed/Writer.php

@@ -76,10 +76,10 @@ class Zend_Feed_Writer
      * @var array
      */
     protected static $_extensions = array(
-        'entry' => array(),
-        'feed' => array(),
+        'entry'         => array(),
+        'feed'          => array(),
         'entryRenderer' => array(),
-        'feedRenderer' => array()
+        'feedRenderer'  => array(),
     );
     
     /**
@@ -155,9 +155,10 @@ class Zend_Feed_Writer
         $entryRendererName = $name . '_Renderer_Entry';
         if (self::isRegistered($name)) {
             if (self::getPluginLoader()->isLoaded($feedName)
-            || self::getPluginLoader()->isLoaded($entryName)
-            || self::getPluginLoader()->isLoaded($feedRendererName)
-            || self::getPluginLoader()->isLoaded($entryRendererName)) {
+                || self::getPluginLoader()->isLoaded($entryName)
+                || self::getPluginLoader()->isLoaded($feedRendererName)
+                || self::getPluginLoader()->isLoaded($entryRendererName)
+            ) {
                 return;
             }
         }
@@ -182,9 +183,9 @@ class Zend_Feed_Writer
         } catch (Zend_Loader_PluginLoader_Exception $e) {
         }
         if (!self::getPluginLoader()->isLoaded($feedName)
-        && !self::getPluginLoader()->isLoaded($entryName)
-        && !self::getPluginLoader()->isLoaded($feedRendererName)
-        && !self::getPluginLoader()->isLoaded($entryRendererName)
+            && !self::getPluginLoader()->isLoaded($entryName)
+            && !self::getPluginLoader()->isLoaded($feedRendererName)
+            && !self::getPluginLoader()->isLoaded($entryRendererName)
         ) {
             require_once 'Zend/Feed/Exception.php';
             throw new Zend_Feed_Exception('Could not load extension: ' . $name
@@ -205,9 +206,9 @@ class Zend_Feed_Writer
         $feedRendererName  = $extensionName . '_Renderer_Feed';
         $entryRendererName = $extensionName . '_Renderer_Entry';
         if (in_array($feedName, self::$_extensions['feed'])
-        || in_array($entryName, self::$_extensions['entry'])
-        || in_array($feedRendererName, self::$_extensions['feedRenderer'])
-        || in_array($entryRendererName, self::$_extensions['entryRenderer'])
+            || in_array($entryName, self::$_extensions['entry'])
+            || in_array($feedRendererName, self::$_extensions['feedRenderer'])
+            || in_array($entryRendererName, self::$_extensions['entryRenderer'])
         ) {
             return true;
         }
@@ -231,13 +232,13 @@ class Zend_Feed_Writer
      */
     public static function reset()
     {
-        self::$_pluginLoader       = null;
-        self::$_prefixPaths        = array();
-        self::$_extensions         = array(
-            'entry' => array(),
-            'feed' => array(),
+        self::$_pluginLoader = null;
+        self::$_prefixPaths  = array();
+        self::$_extensions   = array(
+            'entry'         => array(),
+            'feed'          => array(),
             'entryRenderer' => array(),
-            'feedRenderer' => array()
+            'feedRenderer'  => array(),
         );
     }
 

+ 8 - 3
library/Zend/Feed/Writer/Entry.php

@@ -82,7 +82,10 @@ class Zend_Feed_Writer_Entry
     {
         $author = array();
         if (is_array($name)) {
-            if (!array_key_exists('name', $name) || empty($name['name']) || !is_string($name['name'])) {
+            if (!array_key_exists('name', $name) 
+                || empty($name['name']) 
+                || !is_string($name['name'])
+            ) {
                 require_once 'Zend/Feed/Exception.php';
                 throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value');
             }
@@ -95,7 +98,10 @@ class Zend_Feed_Writer_Entry
                 $author['email'] = $name['email'];
             }
             if (isset($name['uri'])) {
-                if (empty($name['uri']) || !is_string($name['uri']) || !Zend_Uri::check($name['uri'])) {
+                if (empty($name['uri']) 
+                    || !is_string($name['uri']) 
+                    || !Zend_Uri::check($name['uri'])
+                ) {
                     require_once 'Zend/Feed/Exception.php';
                     throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI');
                 }
@@ -663,5 +669,4 @@ class Zend_Feed_Writer_Entry
             $this->_extensions[$ext]->setEncoding($this->getEncoding());
         }
     }
-
 }

+ 28 - 6
library/Zend/Feed/Writer/Extension/Atom/Renderer/Feed.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_Atom_Renderer_Feed
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render feed
+     * 
+     * @return void
+     */
     public function render()
     {
         /**
@@ -48,12 +52,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setHubs($this->_dom, $this->_base);
     }
     
+    /**
+     * Append namespaces to root element of feed
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:atom',
             'http://www.w3.org/2005/Atom');  
     }
 
+    /**
+     * Set feed link elements
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setFeedLinks(DOMDocument $dom, DOMElement $root)
     {
         $flinks = $this->getDataContainer()->getFeedLinks();
@@ -61,7 +77,7 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             return;
         }
         foreach ($flinks as $type => $href) {
-            $mime = 'application/' . strtolower($type) . '+xml';
+            $mime  = 'application/' . strtolower($type) . '+xml';
             $flink = $dom->createElement('atom:link');
             $root->appendChild($flink);
             $flink->setAttribute('rel', 'self');
@@ -70,6 +86,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
     
+    /**
+     * Set PuSH hubs
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setHubs(DOMDocument $dom, DOMElement $root)
     {
         $hubs = $this->getDataContainer()->getHubs();
@@ -83,5 +106,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             $root->appendChild($hub);
         }
     }
-
 }

+ 20 - 5
library/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_Content_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'atom') {
@@ -43,12 +47,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setContent($this->_dom, $this->_base);
     }
     
+    /**
+     * Append namespaces to root element
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:content',
             'http://purl.org/rss/1.0/modules/content/');  
     }
 
+    /**
+     * Set entry content
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setContent(DOMDocument $dom, DOMElement $root)
     {
         $content = $this->getDataContainer()->getContent();
@@ -63,5 +79,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             $this->getDataContainer()->getEncoding()
         );
     }
-
 }

+ 20 - 5
library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_DublinCore_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'atom') {
@@ -43,12 +47,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setAuthors($this->_dom, $this->_base);
     }
     
+    /**
+     * Append namespaces to entry
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:dc',
             'http://purl.org/dc/elements/1.1/');  
     }
 
+    /**
+     * Set entry author elements
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->getDataContainer()->getAuthors();
@@ -63,5 +79,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             }
         }
     }
-
 }

+ 20 - 5
library/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_DublinCore_Renderer_Feed
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render feed
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'atom') {
@@ -43,12 +47,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setAuthors($this->_dom, $this->_base);
     }
     
+    /**
+     * Append namespaces to feed element
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:dc',
             'http://purl.org/dc/elements/1.1/');  
     }
 
+    /**
+     * Set feed authors
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->getDataContainer()->getAuthors();
@@ -63,5 +79,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             }
         }
     }
-
 }

+ 80 - 9
library/Zend/Feed/Writer/Extension/ITunes/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -22,12 +22,11 @@
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_ITunes_Entry
 {
-
     /**
      * Array of Feed data for rendering by Extension's renderers
      *
@@ -42,11 +41,23 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
      */
     protected $_encoding = 'UTF-8';
     
+    /**
+     * Set feed encoding
+     * 
+     * @param  string $enc 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setEncoding($enc)
     {
         $this->_encoding = $enc;
+        return $this;
     }
     
+    /**
+     * Get feed encoding
+     * 
+     * @return string
+     */
     public function getEncoding()
     {
         return $this->_encoding;
@@ -55,7 +66,8 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
     /**
      * Set a block value of "yes" or "no". You may also set an empty string.
      *
-     * @param string
+     * @param  string
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
      */
     public function setItunesBlock($value)
     {
@@ -72,13 +84,26 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
         $this->_data['block'] = $value;
     }
     
+    /**
+     * Add authors to itunes entry
+     * 
+     * @param  array $values 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function addItunesAuthors(array $values)
     {
         foreach ($values as $value) {
             $this->addItunesAuthor($value);
         }
+        return $this;
     }
     
+    /**
+     * Add author to itunes entry
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function addItunesAuthor($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 255) {
@@ -90,21 +115,36 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
             $this->_data['authors'] = array();
         }
         $this->_data['authors'][] = $value;   
+        return $this;
     }
     
+    /**
+     * Set duration
+     * 
+     * @param  int $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setItunesDuration($value)
     {
         $value = (string) $value;
         if (!ctype_digit($value)
-        && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
-        && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)) {
+            && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
+            && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)
+        ) {
             require_once 'Zend/Feed/Exception.php';
             throw new Zend_Feed_Exception('invalid parameter: "duration" may only'
             . ' be of a specified [[HH:]MM:]SS format');
         }
         $this->_data['duration'] = $value;
+        return $this;
     }
     
+    /**
+     * Set "explicit" flag
+     * 
+     * @param  bool $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setItunesExplicit($value)
     {
         if (!in_array($value, array('yes','no','clean'))) {
@@ -113,8 +153,15 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
             . ' be one of "yes", "no" or "clean"');
         }
         $this->_data['explicit'] = $value;
+        return $this;
     }
     
+    /**
+     * Set keywords
+     * 
+     * @param  array $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setItunesKeywords(array $value)
     {
         if (count($value) > 12) {
@@ -130,8 +177,15 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
             . ' by a comma');
         }
         $this->_data['keywords'] = $value;
+        return $this;
     }
     
+    /**
+     * Set subtitle
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setItunesSubtitle($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 255) {
@@ -140,8 +194,15 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
             . ' contain a maximum of 255 characters');
         }
         $this->_data['subtitle'] = $value;
+        return $this;
     }
     
+    /**
+     * Set summary
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Entry
+     */
     public function setItunesSummary($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 4000) {
@@ -150,22 +211,32 @@ class Zend_Feed_Writer_Extension_ITunes_Entry
             . ' contain a maximum of 4000 characters');
         }
         $this->_data['summary'] = $value;
+        return $this;
     }
     
+    /**
+     * Overloading to itunes specific setters
+     * 
+     * @param  string $method 
+     * @param  array $params 
+     * @return mixed
+     */
     public function __call($method, array $params)
     {
         $point = lcfirst(substr($method, 9));
         if (!method_exists($this, 'setItunes' . ucfirst($point))
-        && !method_exists($this, 'addItunes' . ucfirst($point))) {
+            && !method_exists($this, 'addItunes' . ucfirst($point))
+        ) {
             require_once 'Zend/Feed/Writer/Exception/InvalidMethodException.php';
             throw new Zend_Feed_Writer_Exception_InvalidMethodException(
                 'invalid method: ' . $method
             );
         }
-        if (!array_key_exists($point, $this->_data) || empty($this->_data[$point])) {
+        if (!array_key_exists($point, $this->_data) 
+            || empty($this->_data[$point])
+        ) {
             return null;
         }
         return $this->_data[$point];
     }
-
 }

+ 115 - 9
library/Zend/Feed/Writer/Extension/ITunes/Feed.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -22,12 +22,11 @@
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_ITunes_Feed
 {
-
     /**
      * Array of Feed data for rendering by Extension's renderers
      *
@@ -42,11 +41,23 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
      */
     protected $_encoding = 'UTF-8';
     
+    /**
+     * Set feed encoding
+     * 
+     * @param  string $enc 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setEncoding($enc)
     {
         $this->_encoding = $enc;
+        return $this;
     }
     
+    /**
+     * Get feed encoding
+     * 
+     * @return string
+     */
     public function getEncoding()
     {
         return $this->_encoding;
@@ -55,7 +66,8 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
     /**
      * Set a block value of "yes" or "no". You may also set an empty string.
      *
-     * @param string
+     * @param  string
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
      */
     public function setItunesBlock($value)
     {
@@ -70,15 +82,29 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' contain a maximum of 255 characters');
         }
         $this->_data['block'] = $value;
+        return $this;
     }
     
+    /**
+     * Add feed authors
+     * 
+     * @param  array $values 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function addItunesAuthors(array $values)
     {
         foreach ($values as $value) {
             $this->addItunesAuthor($value);
         }
+        return $this;
     }
     
+    /**
+     * Add feed author
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function addItunesAuthor($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 255) {
@@ -90,8 +116,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             $this->_data['authors'] = array();
         }
         $this->_data['authors'][] = $value;   
+        return $this;
     }
     
+    /**
+     * Set feed categories
+     * 
+     * @param  array $values 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesCategories(array $values)
     {
         if (!isset($this->_data['categories'])) {
@@ -122,8 +155,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
                 } 
             }
         }
+        return $this;
     }
     
+    /**
+     * Set feed image (icon)
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesImage($value)
     {
         if (!Zend_Uri::check($value)) {
@@ -138,21 +178,36 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' characters of the URI (i.e. no query string or fragment)');
         }
         $this->_data['image'] = $value;
+        return $this;
     }
     
+    /**
+     * Set feed cumulative duration
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesDuration($value)
     {
         $value = (string) $value;
         if (!ctype_digit($value)
-        && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
-        && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)) {
+            && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value)
+            && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value)
+        ) {
             require_once 'Zend/Feed/Exception.php';
             throw new Zend_Feed_Exception('invalid parameter: "duration" may only'
             . ' be of a specified [[HH:]MM:]SS format');
         }
         $this->_data['duration'] = $value;
+        return $this;
     }
     
+    /**
+     * Set "explicit" flag
+     * 
+     * @param  bool $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesExplicit($value)
     {
         if (!in_array($value, array('yes','no','clean'))) {
@@ -161,8 +216,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' be one of "yes", "no" or "clean"');
         }
         $this->_data['explicit'] = $value;
+        return $this;
     }
     
+    /**
+     * Set feed keywords
+     * 
+     * @param  array $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesKeywords(array $value)
     {
         if (count($value) > 12) {
@@ -178,8 +240,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' by a comma');
         }
         $this->_data['keywords'] = $value;
+        return $this;
     }
     
+    /**
+     * Set new feed URL
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesNewFeedUrl($value)
     {
         if (!Zend_Uri::check($value)) {
@@ -188,15 +257,29 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' be a valid URI/IRI');
         }
         $this->_data['newFeedUrl'] = $value;
+        return $this;
     }
     
+    /**
+     * Add feed owners
+     * 
+     * @param  array $values 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function addItunesOwners(array $values)
     {
         foreach ($values as $value) {
             $this->addItunesOwner($value); 
         }
+        return $this;
     }
     
+    /**
+     * Add feed owner
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function addItunesOwner(array $value)
     {
         if (!isset($value['name']) || !isset($value['email'])) {
@@ -205,7 +288,8 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' be an array containing keys "name" and "email"');
         }
         if (iconv_strlen($value['name'], $this->getEncoding()) > 255
-        || iconv_strlen($value['email'], $this->getEncoding()) > 255) {
+            || iconv_strlen($value['email'], $this->getEncoding()) > 255
+        ) {
             require_once 'Zend/Feed/Exception.php';
             throw new Zend_Feed_Exception('invalid parameter: any "owner" may only'
             . ' contain a maximum of 255 characters each for "name" and "email"');
@@ -214,8 +298,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             $this->_data['owners'] = array();
         }
         $this->_data['owners'][] = $value;
+        return $this;
     }
     
+    /**
+     * Set feed subtitle
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesSubtitle($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 255) {
@@ -224,8 +315,15 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' contain a maximum of 255 characters');
         }
         $this->_data['subtitle'] = $value;
+        return $this;
     }
     
+    /**
+     * Set feed summary
+     * 
+     * @param  string $value 
+     * @return Zend_Feed_Writer_Extension_ITunes_Feed
+     */
     public function setItunesSummary($value)
     {
         if (iconv_strlen($value, $this->getEncoding()) > 4000) {
@@ -234,13 +332,22 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
             . ' contain a maximum of 4000 characters');
         }
         $this->_data['summary'] = $value;
+        return $this;
     }
     
+    /**
+     * Overloading: proxy to internal setters
+     * 
+     * @param  string $method 
+     * @param  array $params 
+     * @return mixed
+     */
     public function __call($method, array $params)
     {
         $point = lcfirst(substr($method, 9));
         if (!method_exists($this, 'setItunes' . ucfirst($point))
-        && !method_exists($this, 'addItunes' . ucfirst($point))) {
+            && !method_exists($this, 'addItunes' . ucfirst($point))
+        ) {
             require_once 'Zend/Feed/Writer/Exception/InvalidMethodException.php';
             throw new Zend_Feed_Writer_Exception_InvalidMethodException(
                 'invalid method: ' . $method
@@ -251,5 +358,4 @@ class Zend_Feed_Writer_Extension_ITunes_Feed
         }
         return $this->_data[$point];
     }
-
 }

+ 62 - 5
library/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_ITunes_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         $this->_appendNamespaces();
@@ -46,12 +50,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setSummary($this->_dom, $this->_base);
     }
     
+    /**
+     * Append namespaces to entry root
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:itunes',
             'http://www.itunes.com/dtds/podcast-1.0.dtd');  
     }
 
+    /**
+     * Set entry authors
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->getDataContainer()->getItunesAuthors();
@@ -67,6 +83,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
     
+    /**
+     * Set itunes block
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setBlock(DOMDocument $dom, DOMElement $root)
     {
         $block = $this->getDataContainer()->getItunesBlock();
@@ -78,6 +101,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set entry duration
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDuration(DOMDocument $dom, DOMElement $root)
     {
         $duration = $this->getDataContainer()->getItunesDuration();
@@ -89,6 +119,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set explicit flag
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setExplicit(DOMDocument $dom, DOMElement $root)
     {
         $explicit = $this->getDataContainer()->getItunesExplicit();
@@ -100,6 +137,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set entry keywords
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setKeywords(DOMDocument $dom, DOMElement $root)
     {
         $keywords = $this->getDataContainer()->getItunesKeywords();
@@ -113,6 +157,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set entry subtitle
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setSubtitle(DOMDocument $dom, DOMElement $root)
     {
         $subtitle = $this->getDataContainer()->getItunesSubtitle();
@@ -126,6 +177,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set entry summary
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setSummary(DOMDocument $dom, DOMElement $root)
     {
         $summary = $this->getDataContainer()->getItunesSummary();
@@ -138,5 +196,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         );
         $root->appendChild($el);
     }
-
 }

+ 90 - 5
library/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_ITunes_Renderer_Feed
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render feed
+     * 
+     * @return void
+     */
     public function render()
     {
         $this->_appendNamespaces();
@@ -50,12 +54,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setSummary($this->_dom, $this->_base);
     }
     
+    /**
+     * Append feed namespaces
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:itunes',
             'http://www.itunes.com/dtds/podcast-1.0.dtd');  
     }
 
+    /**
+     * Set feed authors
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->getDataContainer()->getItunesAuthors();
@@ -71,6 +87,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
     
+    /**
+     * Set feed itunes block
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setBlock(DOMDocument $dom, DOMElement $root)
     {
         $block = $this->getDataContainer()->getItunesBlock();
@@ -82,6 +105,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed categories
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCategories(DOMDocument $dom, DOMElement $root)
     {
         $cats = $this->getDataContainer()->getItunesCategories();
@@ -112,6 +142,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
     
+    /**
+     * Set feed image (icon)
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setImage(DOMDocument $dom, DOMElement $root)
     {
         $image = $this->getDataContainer()->getItunesImage();
@@ -123,6 +160,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed cumulative duration
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDuration(DOMDocument $dom, DOMElement $root)
     {
         $duration = $this->getDataContainer()->getItunesDuration();
@@ -134,6 +178,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set explicit flag
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setExplicit(DOMDocument $dom, DOMElement $root)
     {
         $explicit = $this->getDataContainer()->getItunesExplicit();
@@ -145,6 +196,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed keywords
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setKeywords(DOMDocument $dom, DOMElement $root)
     {
         $keywords = $this->getDataContainer()->getItunesKeywords();
@@ -158,6 +216,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed's new URL
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root)
     {
         $url = $this->getDataContainer()->getItunesNewFeedUrl();
@@ -171,6 +236,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed owners 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setOwners(DOMDocument $dom, DOMElement $root)
     {
         $owners = $this->getDataContainer()->getItunesOwners();
@@ -193,6 +265,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
     
+    /**
+     * Set feed subtitle
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setSubtitle(DOMDocument $dom, DOMElement $root)
     {
         $subtitle = $this->getDataContainer()->getItunesSubtitle();
@@ -206,6 +285,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($el);
     }
     
+    /**
+     * Set feed summary
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setSummary(DOMDocument $dom, DOMElement $root)
     {
         $summary = $this->getDataContainer()->getItunesSummary();
@@ -218,5 +304,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         );
         $root->appendChild($el);
     }
-
 }

+ 80 - 4
library/Zend/Feed/Writer/Extension/RendererAbstract.php

@@ -30,19 +30,36 @@ require_once 'Zend/Feed/Writer/Extension/RendererInterface.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 abstract class Zend_Feed_Writer_Extension_RendererAbstract
-implements Zend_Feed_Writer_Extension_RendererInterface
+    implements Zend_Feed_Writer_Extension_RendererInterface
 {
-
+    /**
+     * @var DOMDocument
+     */
     protected $_dom = null;
     
+    /**
+     * @var mixed
+     */
     protected $_entry = null;
     
+    /**
+     * @var DOMElement
+     */
     protected $_base = null;
     
+    /**
+     * @var mixed
+     */
     protected $_container = null;
     
+    /**
+     * @var string
+     */
     protected $_type = null;
     
+    /**
+     * @var DOMElement
+     */
     protected $_rootElement = null;
     
     /**
@@ -52,52 +69,111 @@ implements Zend_Feed_Writer_Extension_RendererInterface
      */
     protected $_encoding = 'UTF-8';
 
+    /**
+     * Constructor
+     * 
+     * @param  mixed $container 
+     * @return void
+     */
     public function __construct($container)
     {
         $this->_container = $container;
     }
     
+    /**
+     * Set feed encoding
+     * 
+     * @param  string $enc 
+     * @return Zend_Feed_Writer_Extension_RendererAbstract
+     */
     public function setEncoding($enc)
     {
         $this->_encoding = $enc;
+        return $this;
     }
     
+    /**
+     * Get feed encoding
+     * 
+     * @return void
+     */
     public function getEncoding()
     {
         return $this->_encoding;
     }
     
+    /**
+     * Set DOMDocument and DOMElement on which to operate
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $base 
+     * @return Zend_Feed_Writer_Extension_RendererAbstract
+     */
     public function setDomDocument(DOMDocument $dom, DOMElement $base)
     {
-        $this->_dom = $dom;
+        $this->_dom  = $dom;
         $this->_base = $base;
+        return $this;
     }
     
+    /**
+     * Get data container being rendered
+     * 
+     * @return mixed
+     */
     public function getDataContainer()
     {
         return $this->_container;
     }
     
+    /**
+     * Set feed type
+     * 
+     * @param  string $type 
+     * @return Zend_Feed_Writer_Extension_RendererAbstract
+     */
     public function setType($type)
     {
         $this->_type = $type;
+        return $this;
     }
     
+    /**
+     * Get feedtype
+     * 
+     * @return string
+     */
     public function getType()
     {
         return $this->_type;
     }
     
+    /**
+     * Set root element of document 
+     * 
+     * @param  DOMElement $root 
+     * @return Zend_Feed_Writer_Extension_RendererAbstract
+     */
     public function setRootElement(DOMElement $root)
     {
         $this->_rootElement = $root;
+        return $this;
     }
     
+    /**
+     * Get root element
+     * 
+     * @return DOMElement
+     */
     public function getRootElement()
     {
         return $this->_rootElement;
     }
     
+    /**
+     * Append namespaces to feed
+     * 
+     * @return void
+     */
     abstract protected function _appendNamespaces();
-
 }

+ 23 - 2
library/Zend/Feed/Writer/Extension/RendererInterface.php

@@ -26,13 +26,34 @@
  */
 interface Zend_Feed_Writer_Extension_RendererInterface
 {
-
+    /**
+     * Constructor
+     *
+     * @param  mixed $container 
+     * @return void
+     */
     public function __construct($container);
     
+    /**
+     * Set DOMDocument and DOMElement on which to operate
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $base 
+     * @return void
+     */
     public function setDomDocument(DOMDocument $dom, DOMElement $base);
     
+    /**
+     * Render
+     * 
+     * @return void
+     */
     public function render();
     
+    /**
+     * Retrieve container
+     * 
+     * @return mixed
+     */
     public function getDataContainer();
-
 }

+ 20 - 5
library/Zend/Feed/Writer/Extension/Slash/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_Slash_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'atom') {
@@ -43,12 +47,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setCommentCount($this->_dom, $this->_base);
     }
     
+    /**
+     * Append entry namespaces
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:slash',
             'http://purl.org/rss/1.0/modules/slash/');  
     }
 
+    /**
+     * Set entry comment count
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentCount(DOMDocument $dom, DOMElement $root)
     {
         $count = $this->getDataContainer()->getCommentCount();
@@ -59,5 +75,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $tcount->nodeValue = $count;
         $root->appendChild($tcount);
     }
-
 }

+ 34 - 5
library/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_Threading_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'rss') {
@@ -45,12 +49,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setCommentCount($this->_dom, $this->_base);
     }
     
+    /**
+     * Append entry namespaces
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:thr',
             'http://purl.org/syndication/thread/1.0');  
     }
     
+    /**
+     * Set comment link
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentLink(DOMDocument $dom, DOMElement $root)
     {
         $link = $this->getDataContainer()->getCommentLink();
@@ -69,6 +85,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $root->appendChild($clink);
     }
     
+    /**
+     * Set comment feed links
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
     {
         $links = $this->getDataContainer()->getCommentFeedLinks();
@@ -89,6 +112,13 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         }
     }
 
+    /**
+     * Set entry comment count
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentCount(DOMDocument $dom, DOMElement $root)
     {
         $count = $this->getDataContainer()->getCommentCount();
@@ -99,5 +129,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $tcount->nodeValue = $count;
         $root->appendChild($tcount);
     }
-
 }

+ 20 - 5
library/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php

@@ -14,7 +14,7 @@
  *
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  * @version    $Id$
  */
@@ -27,13 +27,17 @@ require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
 /**
  * @category   Zend
  * @package    Zend_Feed_Writer
- * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Extension_WellFormedWeb_Renderer_Entry
-extends Zend_Feed_Writer_Extension_RendererAbstract
+    extends Zend_Feed_Writer_Extension_RendererAbstract
 {
-
+    /**
+     * Render entry
+     * 
+     * @return void
+     */
     public function render()
     {
         if (strtolower($this->getType()) == 'atom') {
@@ -43,12 +47,24 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
         $this->_setCommentFeedLinks($this->_dom, $this->_base);
     }
     
+    /**
+     * Append entry namespaces
+     * 
+     * @return void
+     */
     protected function _appendNamespaces()
     {
         $this->getRootElement()->setAttribute('xmlns:wfw',
             'http://wellformedweb.org/CommentAPI/');  
     }
     
+    /**
+     * Set entry comment feed links
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
     {
         $links = $this->getDataContainer()->getCommentFeedLinks();
@@ -63,5 +79,4 @@ extends Zend_Feed_Writer_Extension_RendererAbstract
             }
         }
     }
-
 }

+ 4 - 4
library/Zend/Feed/Writer/Feed.php

@@ -57,7 +57,6 @@ require_once 'Zend/Feed/Writer/Renderer/Feed/Rss.php';
  */
 class Zend_Feed_Writer_Feed implements Iterator, Countable
 {
-
     /**
      * Contains all Feed level date to append in feed output
      *
@@ -411,8 +410,10 @@ class Zend_Feed_Writer_Feed implements Iterator, Countable
             . ' readable category name');
         }
         if (isset($category['scheme'])) {
-            if (empty($category['scheme']) || !is_string($category['scheme'])
-            || !Zend_Uri::check($category['scheme'])) {
+            if (empty($category['scheme']) 
+                || !is_string($category['scheme'])
+                || !Zend_Uri::check($category['scheme'])
+            ) {
                 require_once 'Zend/Feed/Exception.php';
                 throw new Zend_Feed_Exception('The Atom scheme or RSS domain of'
                 . ' a category must be a valid URI');
@@ -896,5 +897,4 @@ class Zend_Feed_Writer_Feed implements Iterator, Countable
             $this->_extensions[$ext]->setEncoding($this->getEncoding());
         }
     }
-
 }

+ 69 - 4
library/Zend/Feed/Writer/Renderer/Entry/Atom.php

@@ -31,15 +31,25 @@ require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Renderer_Entry_Atom
-extends Zend_Feed_Writer_Renderer_RendererAbstract
-implements Zend_Feed_Writer_Renderer_RendererInterface
+    extends Zend_Feed_Writer_Renderer_RendererAbstract
+    implements Zend_Feed_Writer_Renderer_RendererInterface
 {
-
+    /**
+     * Constructor
+     * 
+     * @param  Zend_Feed_Writer_Entry $container 
+     * @return void
+     */
     public function __construct (Zend_Feed_Writer_Entry $container)
     {
         parent::__construct($container);
     }
 
+    /**
+     * Render atom entry
+     * 
+     * @return Zend_Feed_Writer_Renderer_Entry_Atom
+     */
     public function render()
     {
         $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding());
@@ -67,6 +77,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         return $this;
     }
     
+    /**
+     * Set entry title
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setTitle(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getTitle()) {
@@ -88,6 +105,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $title->appendChild($cdata);
     }
     
+    /**
+     * Set entry description
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDescription(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDescription()) {
@@ -102,6 +126,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $subtitle->appendChild($cdata);
     }
     
+    /**
+     * Set date entry was modified
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateModified(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateModified()) {
@@ -123,6 +154,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             ->get(Zend_Date::ISO_8601);
     }
     
+    /**
+     * Set date entry was created
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
     {
         if (!$this->getDataContainer()->getDateCreated()) {
@@ -134,6 +172,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             ->get(Zend_Date::ISO_8601);
     }
     
+    /**
+     * Set entry authors 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->_container->getAuthors();
@@ -163,6 +208,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set entry enclosure
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setEnclosure(DOMDocument $dom, DOMElement $root)
     {
         $data = $this->_container->getEnclosure();
@@ -189,6 +241,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $link->setAttribute('href', $this->getDataContainer()->getLink());
     }
     
+    /**
+     * Set entry identifier 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setId(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getId()
@@ -221,6 +280,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $id->nodeValue = $this->getDataContainer()->getId();
     }
     
+    /**
+     * Set entry content 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setContent(DOMDocument $dom, DOMElement $root)
     {
         $content = $this->getDataContainer()->getContent();
@@ -244,5 +310,4 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $element->appendChild($cdata);
         $root->appendChild($element);
     }
-
 }

+ 76 - 4
library/Zend/Feed/Writer/Renderer/Entry/Rss.php

@@ -31,15 +31,25 @@ require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Renderer_Entry_Rss
-extends Zend_Feed_Writer_Renderer_RendererAbstract
-implements Zend_Feed_Writer_Renderer_RendererInterface
+    extends Zend_Feed_Writer_Renderer_RendererAbstract
+    implements Zend_Feed_Writer_Renderer_RendererInterface
 {
-
+    /**
+     * Constructor
+     * 
+     * @param  Zend_Feed_Writer_Entry $container 
+     * @return void
+     */
     public function __construct (Zend_Feed_Writer_Entry $container)
     {
         parent::__construct($container);
     }
     
+    /**
+     * Render RSS entry
+     * 
+     * @return Zend_Feed_Writer_Renderer_Entry_Rss
+     */
     public function render()
     {
         $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding());
@@ -66,6 +76,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         return $this;
     }
     
+    /**
+     * Set entry title
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setTitle(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDescription()
@@ -91,6 +108,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         );
     }
     
+    /**
+     * Set entry description
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDescription(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDescription()
@@ -117,6 +141,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         );
     }
     
+    /**
+     * Set date entry was last modified
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateModified(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateModified()) {
@@ -129,6 +160,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             ->get(Zend_Date::RSS);
     }
     
+    /**
+     * Set date entry was created
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
     {
         if (!$this->getDataContainer()->getDateCreated()) {
@@ -141,6 +179,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set entry authors
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->_container->getAuthors();
@@ -158,6 +203,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set entry enclosure
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setEnclosure(DOMDocument $dom, DOMElement $root)
     {
         $data = $this->_container->getEnclosure();
@@ -171,6 +223,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $root->appendChild($enclosure);
     }
     
+    /**
+     * Set link to entry
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setLink(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getLink()) {
@@ -181,6 +240,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $link->nodeValue = $this->getDataContainer()->getLink();
     }
     
+    /**
+     * Set entry identifier
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setId(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getId()
@@ -200,6 +266,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set link to entry comments
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCommentLink(DOMDocument $dom, DOMElement $root)
     {
         $link = $this->getDataContainer()->getCommentLink();
@@ -210,5 +283,4 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $clink->nodeValue = $link;
         $root->appendChild($clink);
     }
-
 }

+ 116 - 4
library/Zend/Feed/Writer/Renderer/Feed/Atom.php

@@ -19,14 +19,19 @@
  * @version    $Id$
  */
 
+/** @see Zend_Feed_Writer_Feed */
 require_once 'Zend/Feed/Writer/Feed.php';
 
+/** @see Zend_Version */
 require_once 'Zend/Version.php';
 
+/** @see Zend_Feed_Writer_Renderer_RendererInterface */
 require_once 'Zend/Feed/Writer/Renderer/RendererInterface.php';
 
+/** @see Zend_Feed_Writer_Renderer_Entry_Atom */
 require_once 'Zend/Feed/Writer/Renderer/Entry/Atom.php';
 
+/** @see Zend_Feed_Writer_Renderer_RendererAbstract */
 require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
 
 /**
@@ -36,15 +41,25 @@ require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Renderer_Feed_Atom
-extends Zend_Feed_Writer_Renderer_RendererAbstract
-implements Zend_Feed_Writer_Renderer_RendererInterface
+    extends Zend_Feed_Writer_Renderer_RendererAbstract
+    implements Zend_Feed_Writer_Renderer_RendererInterface
 {
-
+    /**
+     * Constructor
+     * 
+     * @param  Zend_Feed_Writer_Feed $container 
+     * @return void
+     */
     public function __construct (Zend_Feed_Writer_Feed $container)
     {
         parent::__construct($container);
     }
 
+    /**
+     * Render Atom feed
+     * 
+     * @return Zend_Feed_Writer_Renderer_Feed_Atom
+     */
     public function render()
     {
         if (!$this->_container->getEncoding()) {
@@ -97,6 +112,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         return $this;
     }
 
+    /**
+     * Set feed language
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setLanguage(DOMDocument $dom, DOMElement $root)
     {
         if ($this->getDataContainer()->getLanguage()) {
@@ -105,6 +127,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
 
+    /**
+     * Set feed title
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setTitle(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getTitle()) {
@@ -126,6 +155,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $title->nodeValue = $this->getDataContainer()->getTitle();
     }
 
+    /**
+     * Set feed description
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDescription(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDescription()) {
@@ -137,6 +173,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $subtitle->nodeValue = $this->getDataContainer()->getDescription();
     }
 
+    /**
+     * Set date feed was last modified
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateModified(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateModified()) {
@@ -158,6 +201,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             ->get(Zend_Date::ISO_8601);
     }
 
+    /**
+     * Set feed generator string
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setGenerator(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getGenerator()) {
@@ -177,6 +227,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
 
+    /**
+     * Set link to feed
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setLink(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getLink()) {
@@ -189,6 +246,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $link->setAttribute('href', $this->getDataContainer()->getLink());
     }
 
+    /**
+     * Set feed links
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setFeedLinks(DOMDocument $dom, DOMElement $root)
     {
         $flinks = $this->getDataContainer()->getFeedLinks();
@@ -217,6 +281,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set feed authors 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->_container->getAuthors();
@@ -247,6 +318,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
 
+    /**
+     * Set feed identifier
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setId(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getId()
@@ -274,6 +352,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $id->nodeValue = $this->getDataContainer()->getId();
     }
     
+    /**
+     * Set feed copyright
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCopyright(DOMDocument $dom, DOMElement $root)
     {
         $copyright = $this->getDataContainer()->getCopyright();
@@ -285,6 +370,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $copy->nodeValue = $copyright;
     }
     
+    /**
+     * Set date feed was created 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateCreated()) {
@@ -297,6 +389,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set base URL to feed links
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setBaseUrl(DOMDocument $dom, DOMElement $root)
     {
         $baseUrl = $this->getDataContainer()->getBaseUrl();
@@ -306,6 +405,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $root->setAttribute('xml:base', $baseUrl);
     }
     
+    /**
+     * Set hubs to which this feed pushes 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setHubs(DOMDocument $dom, DOMElement $root)
     {
         $hubs = $this->getDataContainer()->getHubs();
@@ -320,6 +426,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set feed cateories 
+     * 
+     * @param  DOMDocument $dom 
+     * @param  DOMElement $root 
+     * @return void
+     */
     protected function _setCategories(DOMDocument $dom, DOMElement $root)
     {
         $categories = $this->getDataContainer()->getCategories();
@@ -344,5 +457,4 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             $root->appendChild($category);
         }
     }
-
 }

+ 95 - 4
library/Zend/Feed/Writer/Renderer/Feed/Rss.php

@@ -19,14 +19,19 @@
  * @version    $Id$
  */
 
+/** @see Zend_Feed_Writer_Feed */
 require_once 'Zend/Feed/Writer/Feed.php';
 
+/** @see Zend_Version */
 require_once 'Zend/Version.php';
 
+/** @see Zend_Feed_Writer_Renderer_RendererInterface */
 require_once 'Zend/Feed/Writer/Renderer/RendererInterface.php';
 
+/** @see Zend_Feed_Writer_Renderer_Entry_Rss */
 require_once 'Zend/Feed/Writer/Renderer/Entry/Rss.php';
 
+/** @see Zend_Feed_Writer_Renderer_RendererAbstract */
 require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
 
 /**
@@ -36,15 +41,25 @@ require_once 'Zend/Feed/Writer/Renderer/RendererAbstract.php';
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 class Zend_Feed_Writer_Renderer_Feed_Rss
-extends Zend_Feed_Writer_Renderer_RendererAbstract
-implements Zend_Feed_Writer_Renderer_RendererInterface
+    extends Zend_Feed_Writer_Renderer_RendererAbstract
+    implements Zend_Feed_Writer_Renderer_RendererInterface
 {
-
+    /**
+     * Constructor
+     * 
+     * @param  Zend_Feed_Writer_Feed $container 
+     * @return void
+     */
     public function __construct (Zend_Feed_Writer_Feed $container)
     {
         parent::__construct($container);
     }
 
+    /**
+     * Render RSS feed
+     * 
+     * @return Zend_Feed_Writer_Renderer_Feed_Rss
+     */
     public function render()
     {
         if (!$this->_container->getEncoding()) {
@@ -96,6 +111,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         return $this;
     }
 
+    /**
+     * Set feed language
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setLanguage(DOMDocument $dom, DOMElement $root)
     {
         $lang = $this->getDataContainer()->getLanguage();
@@ -107,6 +129,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $language->nodeValue = $lang;
     }
 
+    /**
+     * Set feed title
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setTitle(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getTitle()) {
@@ -131,6 +160,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         );
     }
 
+    /**
+     * Set feed description
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setDescription(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDescription()) {
@@ -154,6 +190,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         );
     }
 
+    /**
+     * Set date feed was last modified
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setDateModified(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateModified()) {
@@ -166,6 +209,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             ->get(Zend_Date::RSS);
     }
 
+    /**
+     * Set feed generator string
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setGenerator(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getGenerator()) {
@@ -186,6 +236,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $generator->nodeValue = $name;
     }
 
+    /**
+     * Set link to feed
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setLink(DOMDocument $dom, DOMElement $root)
     {
         $value = $this->getDataContainer()->getLink();
@@ -209,6 +266,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set feed authors
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setAuthors(DOMDocument $dom, DOMElement $root)
     {
         $authors = $this->getDataContainer()->getAuthors();
@@ -226,6 +290,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set feed copyright
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setCopyright(DOMDocument $dom, DOMElement $root)
     {
         $copyright = $this->getDataContainer()->getCopyright();
@@ -237,6 +308,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $copy->nodeValue = $copyright;
     }
     
+    /**
+     * Set date feed was created
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setDateCreated(DOMDocument $dom, DOMElement $root)
     {
         if(!$this->getDataContainer()->getDateCreated()) {
@@ -249,6 +327,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         }
     }
     
+    /**
+     * Set base URL to feed links
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setBaseUrl(DOMDocument $dom, DOMElement $root)
     {
         $baseUrl = $this->getDataContainer()->getBaseUrl();
@@ -258,6 +343,13 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
         $root->setAttribute('xml:base', $baseUrl);
     }
     
+    /**
+     * Set feed categories
+     * 
+     * @param DOMDocument $dom 
+     * @param DOMElement $root 
+     * @return void
+     */
     protected function _setCategories(DOMDocument $dom, DOMElement $root)
     {
         $categories = $this->getDataContainer()->getCategories();
@@ -273,5 +365,4 @@ implements Zend_Feed_Writer_Renderer_RendererInterface
             $root->appendChild($category);
         }
     }
-
 }

+ 71 - 2
library/Zend/Feed/Writer/Renderer/RendererAbstract.php

@@ -19,8 +19,10 @@
  * @version    $Id$
  */
  
+/** @see Zend_Feed_Writer */
 require_once 'Zend/Feed/Writer.php';
 
+/** @see Zend_Version */
 require_once 'Zend/Version.php';
  
 /**
@@ -31,15 +33,30 @@ require_once 'Zend/Version.php';
  */
 class Zend_Feed_Writer_Renderer_RendererAbstract
 {
-
+    /**
+     * Extensions
+     * @var array
+     */
     protected $_extensions = array();
     
+    /**
+     * @var mixed
+     */
     protected $_container = null;
 
+    /**
+     * @var DOMDocument
+     */
     protected $_dom = null;
 
+    /**
+     * @var bool
+     */
     protected $_ignoreExceptions = false;
 
+    /**
+     * @var array
+     */
     protected $_exceptions = array();
     
     /**
@@ -57,8 +74,17 @@ class Zend_Feed_Writer_Renderer_RendererAbstract
      */
     protected $_type = null;
     
+    /**
+     * @var DOMElement
+     */
     protected $_rootElement = null;
 
+    /**
+     * Constructor
+     * 
+     * @param  mixed $container 
+     * @return void
+     */
     public function __construct($container)
     {
         $this->_container = $container;
@@ -66,36 +92,74 @@ class Zend_Feed_Writer_Renderer_RendererAbstract
         $this->_loadExtensions();
     }
     
+    /**
+     * Save XML to string
+     * 
+     * @return string
+     */
     public function saveXml()
     {
         return $this->getDomDocument()->saveXml();
     }
 
+    /**
+     * Get DOM document
+     * 
+     * @return DOMDocument
+     */
     public function getDomDocument()
     {
         return $this->_dom;
     }
 
+    /**
+     * Get document element from DOM
+     * 
+     * @return DOMElement
+     */
     public function getElement()
     {
         return $this->getDomDocument()->documentElement;
     }
 
+    /**
+     * Get data container of items being rendered
+     * 
+     * @return mixed
+     */
     public function getDataContainer()
     {
         return $this->_container;
     }
     
+    /**
+     * Set feed encoding
+     * 
+     * @param  string $enc 
+     * @return Zend_Feed_Writer_Renderer_RendererAbstract
+     */
     public function setEncoding($enc)
     {
         $this->_encoding = $enc;
+        return $this;
     }
     
+    /**
+     * Get feed encoding
+     * 
+     * @return string
+     */
     public function getEncoding()
     {
         return $this->_encoding;
     }
 
+    /**
+     * Indicate whether or not to ignore exceptions
+     * 
+     * @param  bool $bool 
+     * @return Zend_Feed_Writer_Renderer_RendererAbstract
+     */
     public function ignoreExceptions($bool = true)
     {
         if (!is_bool($bool)) {
@@ -103,8 +167,14 @@ class Zend_Feed_Writer_Renderer_RendererAbstract
             throw new Zend_Feed_Exception('Invalid parameter: $bool. Should be TRUE or FALSE (defaults to TRUE if null)');
         }
         $this->_ignoreExceptions = $bool;
+        return $this;
     }
 
+    /**
+     * Get exception list
+     * 
+     * @return array
+     */
     public function getExceptions()
     {
         return $this->_exceptions;
@@ -177,5 +247,4 @@ class Zend_Feed_Writer_Renderer_RendererAbstract
             $this->_extensions[$extension]->setEncoding($this->getEncoding());
         }
     }
-
 }

+ 35 - 2
library/Zend/Feed/Writer/Renderer/RendererInterface.php

@@ -27,19 +27,53 @@
  */
 interface Zend_Feed_Writer_Renderer_RendererInterface
 {
-
+    /**
+     * Render feed/entry
+     * 
+     * @return void
+     */
     public function render();
 
+    /**
+     * Save feed and/or entry to XML and return string
+     * 
+     * @return string
+     */
     public function saveXml();
 
+    /**
+     * Get DOM document
+     * 
+     * @return DOMDocument
+     */
     public function getDomDocument();
 
+    /**
+     * Get document element from DOM
+     * 
+     * @return DOMElement
+     */
     public function getElement();
 
+    /**
+     * Get data container containing feed items
+     * 
+     * @return mixed
+     */
     public function getDataContainer();
 
+    /**
+     * Should exceptions be ignored?
+     * 
+     * @return mixed
+     */
     public function ignoreExceptions();
     
+    /**
+     * Get list of thrown exceptions
+     * 
+     * @return array
+     */
     public function getExceptions();
     
     /**
@@ -74,5 +108,4 @@ interface Zend_Feed_Writer_Renderer_RendererInterface
      * @return DOMElement
      */
     public function getRootElement();
-
 }