diff --git a/src/PubSubHubbub/Model/Subscription.php b/src/PubSubHubbub/Model/Subscription.php index c4682770..07fb7947 100644 --- a/src/PubSubHubbub/Model/Subscription.php +++ b/src/PubSubHubbub/Model/Subscription.php @@ -23,11 +23,11 @@ class Subscription extends AbstractModel implements SubscriptionPersistenceInter { /** * Common DateTime object to assist with unit testing - * + * * @var DateTime */ protected $now; - + /** * Save subscription to RDMBS * @@ -46,7 +46,7 @@ public function setSubscription(array $data) if ($result && (0 < count($result))) { $data['created_time'] = $result->current()->created_time; $now = $this->getNow(); - if (array_key_exists('lease_seconds', $data) + if (array_key_exists('lease_seconds', $data) && $data['lease_seconds'] ) { $data['expiration_time'] = $now->add(new DateInterval('PT' . $data['lease_seconds'] . 'S')) @@ -62,11 +62,11 @@ public function setSubscription(array $data) $this->_db->insert($data); return true; } - + /** * Get subscription by ID/key - * - * @param string $key + * + * @param string $key * @return array * @throws PubSubHubbub\Exception\InvalidArgumentException */ @@ -85,8 +85,8 @@ public function getSubscription($key) /** * Determine if a subscription matching the key exists - * - * @param string $key + * + * @param string $key * @return bool * @throws PubSubHubbub\Exception\InvalidArgumentException */ @@ -123,7 +123,7 @@ public function deleteSubscription($key) /** * Get a new DateTime or the one injected for testing - * + * * @return DateTime */ public function getNow() @@ -136,7 +136,7 @@ public function getNow() /** * Set a DateTime instance for assisting with unit testing - * + * * @param DateTime $now * @return Subscription */ diff --git a/src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php b/src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php index 9c4d29fb..7b0e58e5 100644 --- a/src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php +++ b/src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php @@ -17,7 +17,7 @@ */ interface SubscriptionPersistenceInterface { - + /** * Save subscription to RDMBS * @@ -25,23 +25,23 @@ interface SubscriptionPersistenceInterface * @return bool */ public function setSubscription(array $data); - + /** * Get subscription by ID/key - * - * @param string $key + * + * @param string $key * @return array */ public function getSubscription($key); /** * Determine if a subscription matching the key exists - * - * @param string $key + * + * @param string $key * @return bool */ public function hasSubscription($key); - + /** * Delete a subscription * @@ -49,5 +49,5 @@ public function hasSubscription($key); * @return bool */ public function deleteSubscription($key); - + } diff --git a/src/PubSubHubbub/PubSubHubbub.php b/src/PubSubHubbub/PubSubHubbub.php index d9b1c25f..114f563b 100644 --- a/src/PubSubHubbub/PubSubHubbub.php +++ b/src/PubSubHubbub/PubSubHubbub.php @@ -24,7 +24,7 @@ class PubSubHubbub */ const VERIFICATION_MODE_SYNC = 'sync'; const VERIFICATION_MODE_ASYNC = 'async'; - + /** * Subscription States */ diff --git a/src/PubSubHubbub/Subscriber.php b/src/PubSubHubbub/Subscriber.php index 088076aa..b7d1126b 100644 --- a/src/PubSubHubbub/Subscriber.php +++ b/src/PubSubHubbub/Subscriber.php @@ -108,7 +108,7 @@ class Subscriber * @var array */ protected $_authentications = array(); - + /** * Tells the Subscriber to append any subscription identifier to the path * of the base Callback URL. E.g. an identifier "subkey1" would be added @@ -381,12 +381,12 @@ public function getHubUrls() $this->_hubUrls = array_unique($this->_hubUrls); return $this->_hubUrls; } - + /** * Add authentication credentials for a given URL - * - * @param string $url - * @param array $authentication + * + * @param string $url + * @param array $authentication * @return Subscriber * @throws Exception\InvalidArgumentException */ @@ -400,11 +400,11 @@ public function addAuthentication($url, array $authentication) $this->_authentications[$url] = $authentication; return $this; } - + /** * Add authentication credentials for hub URLs - * - * @param array $authentications + * + * @param array $authentications * @return Subscriber */ public function addAuthentications(array $authentications) @@ -414,21 +414,21 @@ public function addAuthentications(array $authentications) } return $this; } - + /** * Get all hub URL authentication credentials - * + * * @return array */ public function getAuthentications() { return $this->_authentications; } - + /** * Set flag indicating whether or not to use a path parameter - * - * @param bool $bool + * + * @param bool $bool * @return Subscriber */ public function usePathParameter($bool = true) @@ -524,7 +524,7 @@ public function setStorage(Model\SubscriptionPersistenceInterface $storage) } /** - * Gets an instance of Zend\Feed\Pubsubhubbub\Storage\StoragePersistence used + * Gets an instance of Zend\Feed\Pubsubhubbub\Storage\StoragePersistence used * to background save any verification tokens associated with a subscription * or other. * @@ -727,7 +727,7 @@ protected function _getRequestParameters($hubUrl, $mode) foreach ($optParams as $name => $value) { $params[$name] = $value; } - + // store subscription to storage $now = new DateTime(); $expires = null; diff --git a/src/PubSubHubbub/Subscriber/Callback.php b/src/PubSubHubbub/Subscriber/Callback.php index 9ce688c0..d552455a 100644 --- a/src/PubSubHubbub/Subscriber/Callback.php +++ b/src/PubSubHubbub/Subscriber/Callback.php @@ -25,7 +25,7 @@ class Callback extends PubSubHubbub\AbstractCallback * @var string */ protected $_feedUpdate = null; - + /** * Holds a manually set subscription key (i.e. identifies a unique * subscription) which is typical when it is not passed in the query string @@ -35,14 +35,14 @@ class Callback extends PubSubHubbub\AbstractCallback * @var string */ protected $_subscriptionKey = null; - + /** * After verification, this is set to the verified subscription's data. * * @var array */ protected $_currentSubscriptionData = null; - + /** * Set a subscription key to use for the current callback request manually. * Required if usePathParameter is enabled for the Subscriber. @@ -129,9 +129,9 @@ public function isValidHubVerification(array $httpGetData) return false; } $required = array( - 'hub_mode', + 'hub_mode', 'hub_topic', - 'hub_challenge', + 'hub_challenge', 'hub_verify_token', ); foreach ($required as $key) { diff --git a/src/Reader/Collection.php b/src/Reader/Collection.php index 2033ece7..2dada9a0 100644 --- a/src/Reader/Collection.php +++ b/src/Reader/Collection.php @@ -17,6 +17,6 @@ class Collection extends \ArrayObject { - + } diff --git a/src/Reader/Collection/Author.php b/src/Reader/Collection/Author.php index 17d3a61b..133b9871 100644 --- a/src/Reader/Collection/Author.php +++ b/src/Reader/Collection/Author.php @@ -23,7 +23,8 @@ class Author extends AbstractCollection * * @return array */ - public function getValues() { + public function getValues() + { $authors = array(); foreach ($this->getIterator() as $element) { $authors[] = $element['name']; diff --git a/src/Reader/Collection/Category.php b/src/Reader/Collection/Category.php index 377da0bc..92efad94 100644 --- a/src/Reader/Collection/Category.php +++ b/src/Reader/Collection/Category.php @@ -25,7 +25,8 @@ class Category extends AbstractCollection * * @return array */ - public function getValues() { + public function getValues() + { $categories = array(); foreach ($this->getIterator() as $element) { if (isset($element['label']) && !empty($element['label'])) { diff --git a/src/Reader/Collection/Collection.php b/src/Reader/Collection/Collection.php index 8fe3ad0f..6fee75f8 100644 --- a/src/Reader/Collection/Collection.php +++ b/src/Reader/Collection/Collection.php @@ -17,6 +17,6 @@ class Collection extends \ArrayObject { - + } diff --git a/src/Reader/Entry/AbstractEntry.php b/src/Reader/Entry/AbstractEntry.php index 9371f061..7448c226 100644 --- a/src/Reader/Entry/AbstractEntry.php +++ b/src/Reader/Entry/AbstractEntry.php @@ -79,10 +79,10 @@ public function __construct(DOMElement $entry, $entryKey, $type = null) $this->_domDocument = $entry->ownerDocument; if ($type !== null) { $this->_data['type'] = $type; - } else if ($this->_domDocument !== null) { + } elseif ($this->_domDocument !== null) { $this->_data['type'] = Reader\Reader::detectType($this->_domDocument); } else { - $this->_data['type'] = Reader\Reader::TYPE_ANY; + $this->_data['type'] = Reader\Reader::TYPE_ANY; } $this->_loadExtensions(); } diff --git a/src/Reader/Entry/Atom.php b/src/Reader/Entry/Atom.php index 417204d6..7e499181 100644 --- a/src/Reader/Entry/Atom.php +++ b/src/Reader/Entry/Atom.php @@ -47,7 +47,7 @@ public function __construct(DOMElement $entry, $entryKey, $type = null) $threadClass = Reader\Reader::getPluginLoader()->getClassName('Thread\\Entry'); $this->_extensions['Thread\\Entry'] = new $threadClass($entry, $entryKey, $type); - + $threadClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Entry'); $this->_extensions['DublinCore\\Entry'] = new $threadClass($entry, $entryKey, $type); } @@ -317,7 +317,7 @@ public function getCommentFeedLink() return $this->_data['commentfeedlink']; } - + /** * Get category data as a Reader\Reader_Collection_Category object * @@ -330,7 +330,7 @@ public function getCategories() } $categoryCollection = $this->getExtension('Atom')->getCategories(); - + if (count($categoryCollection) == 0) { $categoryCollection = $this->getExtension('DublinCore')->getCategories(); } @@ -339,7 +339,7 @@ public function getCategories() return $this->_data['categories']; } - + /** * Get source feed metadata from the entry * @@ -355,7 +355,7 @@ public function getSource() $this->_data['source'] = $source; - return $this->_data['source']; + return $this->_data['source']; } /** diff --git a/src/Reader/Entry/EntryInterface.php b/src/Reader/Entry/EntryInterface.php index 41a43fc1..4d0fc31d 100644 --- a/src/Reader/Entry/EntryInterface.php +++ b/src/Reader/Entry/EntryInterface.php @@ -124,7 +124,7 @@ public function getCommentLink(); * @return string */ public function getCommentFeedLink(); - + /** * Get all categories * diff --git a/src/Reader/Entry/Rss.php b/src/Reader/Entry/Rss.php index 9c7132ae..3adc8955 100644 --- a/src/Reader/Entry/Rss.php +++ b/src/Reader/Entry/Rss.php @@ -99,7 +99,7 @@ public function getAuthors() if (array_key_exists('authors', $this->_data)) { return $this->_data['authors']; } - + $authors = array(); $authors_dc = $this->getExtension('DublinCore')->getAuthors(); if (!empty($authors_dc)) { @@ -109,7 +109,7 @@ public function getAuthors() ); } } - + if ($this->getType() !== Reader\Reader::TYPE_RSS_10 && $this->getType() !== Reader\Reader::TYPE_RSS_090) { $list = $this->_xpath->query($this->_xpathQueryRss . '//author'); @@ -129,7 +129,7 @@ public function getAuthors() $data['name'] = $matches[1]; } $authors[] = $data; - } + } } } @@ -410,7 +410,7 @@ public function getLinks() return $this->_data['links']; } - + /** * Get all categories * @@ -441,7 +441,7 @@ public function getCategories() } else { $categoryCollection = $this->getExtension('DublinCore')->getCategories(); } - + if (count($categoryCollection) == 0) { $categoryCollection = $this->getExtension('Atom')->getCategories(); } diff --git a/src/Reader/Extension/Atom/Entry.php b/src/Reader/Extension/Atom/Entry.php index cbedbc76..d0be4b1f 100644 --- a/src/Reader/Extension/Atom/Entry.php +++ b/src/Reader/Extension/Atom/Entry.php @@ -94,9 +94,9 @@ public function getContent() if (array_key_exists('content', $this->_data)) { return $this->_data['content']; } - + $content = null; - + $el = $this->getXpath()->query($this->getXpathPrefix() . '/atom:content'); if($el->length > 0) { $el = $el->item(0); @@ -476,7 +476,7 @@ public function getCommentFeedLink($type = 'atom') return $this->_data['commentfeedlink']; } - + /** * Get all categories * @@ -517,7 +517,7 @@ public function getCategories() return $this->_data['categories']; } - + /** * Get source feed metadata from the entry * @@ -528,7 +528,7 @@ public function getSource() if (array_key_exists('source', $this->_data)) { return $this->_data['source']; } - + $source = null; // TODO: Investigate why _getAtomType() fails here. Is it even needed? if ($this->getType() == Reader\Reader::TYPE_ATOM_10) { @@ -538,9 +538,9 @@ public function getSource() $source = new Reader\Feed\Atom\Source($element, $this->getXpathPrefix()); } } - + $this->_data['source'] = $source; - return $this->_data['source']; + return $this->_data['source']; } /** @@ -576,7 +576,7 @@ protected function _getAuthor(DOMElement $element) $emailNode = $element->getElementsByTagName('email'); $nameNode = $element->getElementsByTagName('name'); $uriNode = $element->getElementsByTagName('uri'); - + if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) { $author['email'] = $emailNode->item(0)->nodeValue; } diff --git a/src/Reader/Extension/Atom/Feed.php b/src/Reader/Extension/Atom/Feed.php index 36aaa6a7..0f82880f 100644 --- a/src/Reader/Extension/Atom/Feed.php +++ b/src/Reader/Extension/Atom/Feed.php @@ -369,7 +369,7 @@ public function getHubs() return $this->_data['hubs']; } $hubs = array(); - + $list = $this->_xpath->query($this->getXpathPrefix() . '//atom:link[@rel="hub"]/@href'); @@ -407,7 +407,7 @@ public function getTitle() return $this->_data['title']; } - + /** * Get all categories * @@ -462,7 +462,7 @@ protected function _getAuthor(DOMElement $element) $emailNode = $element->getElementsByTagName('email'); $nameNode = $element->getElementsByTagName('name'); $uriNode = $element->getElementsByTagName('uri'); - + if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) { $author['email'] = $emailNode->item(0)->nodeValue; } diff --git a/src/Reader/Extension/DublinCore/Entry.php b/src/Reader/Extension/DublinCore/Entry.php index 0cddec33..9e9248c2 100644 --- a/src/Reader/Extension/DublinCore/Entry.php +++ b/src/Reader/Extension/DublinCore/Entry.php @@ -81,7 +81,7 @@ public function getAuthors() return $this->_data['authors']; } - + /** * Get categories (subjects under DC) * @@ -92,13 +92,13 @@ public function getCategories() if (array_key_exists('categories', $this->_data)) { return $this->_data['categories']; } - + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject'); if (!$list->length) { $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject'); } - + if ($list->length) { $categoryCollection = new Collection\Category; foreach ($list as $category) { @@ -111,11 +111,11 @@ public function getCategories() } else { $categoryCollection = new Collection\Category; } - + $this->_data['categories'] = $categoryCollection; - return $this->_data['categories']; + return $this->_data['categories']; } - + /** * Get the entry content diff --git a/src/Reader/Extension/DublinCore/Feed.php b/src/Reader/Extension/DublinCore/Feed.php index fb58ecf4..ec2133ab 100644 --- a/src/Reader/Extension/DublinCore/Feed.php +++ b/src/Reader/Extension/DublinCore/Feed.php @@ -62,7 +62,7 @@ public function getAuthors() $list = $this->_xpath->query('//dc10:publisher'); } } - + if ($list->length) { foreach ($list as $author) { $authors[] = array( @@ -238,7 +238,7 @@ public function getDate() return $this->_data['date']; } - + /** * Get categories (subjects under DC) * @@ -249,13 +249,13 @@ public function getCategories() if (array_key_exists('categories', $this->_data)) { return $this->_data['categories']; } - + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject'); if (!$list->length) { $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject'); } - + if ($list->length) { $categoryCollection = new Collection\Category; foreach ($list as $category) { @@ -268,9 +268,9 @@ public function getCategories() } else { $categoryCollection = new Collection\Category; } - + $this->_data['categories'] = $categoryCollection; - return $this->_data['categories']; + return $this->_data['categories']; } /** diff --git a/src/Reader/Extension/Podcast/Feed.php b/src/Reader/Extension/Podcast/Feed.php index a79207b5..8dda6750 100644 --- a/src/Reader/Extension/Podcast/Feed.php +++ b/src/Reader/Extension/Podcast/Feed.php @@ -212,7 +212,7 @@ public function getOwner() if (!empty($email)) { $owner = $email . (empty($name) ? '' : ' (' . $name . ')'); - } else if (!empty($name)) { + } elseif (!empty($name)) { $owner = $name; } diff --git a/src/Reader/Extension/Syndication/Feed.php b/src/Reader/Extension/Syndication/Feed.php index b3f2e649..2e88d0ab 100644 --- a/src/Reader/Extension/Syndication/Feed.php +++ b/src/Reader/Extension/Syndication/Feed.php @@ -36,8 +36,7 @@ public function getUpdatePeriod() return 'daily'; //Default specified by spec } - switch ($period) - { + switch ($period) { case 'hourly': case 'daily': case 'weekly': @@ -84,8 +83,7 @@ public function getUpdateFrequencyAsTicks() $period = $this->getUpdatePeriod(); $ticks = 1; - switch ($period) - { + switch ($period) { //intentional fall through case 'yearly': $ticks *= 52; //TODO: fix generalisation, how? diff --git a/src/Reader/Feed/Atom.php b/src/Reader/Feed/Atom.php index 0b864b22..8490c1d6 100644 --- a/src/Reader/Feed/Atom.php +++ b/src/Reader/Feed/Atom.php @@ -344,7 +344,7 @@ public function getHubs() return $this->_data['hubs']; } - + /** * Get all categories * @@ -357,7 +357,7 @@ public function getCategories() } $categoryCollection = $this->getExtension('Atom')->getCategories(); - + if (count($categoryCollection) == 0) { $categoryCollection = $this->getExtension('DublinCore')->getCategories(); } diff --git a/src/Reader/Feed/Atom/Source.php b/src/Reader/Feed/Atom/Source.php index a221f4a4..7aa3f528 100644 --- a/src/Reader/Feed/Atom/Source.php +++ b/src/Reader/Feed/Atom/Source.php @@ -38,7 +38,7 @@ public function __construct(DOMElement $source, $xpathPrefix, $type = Reader\Rea $this->_data['type'] = $type; $this->_registerNamespaces(); $this->_loadExtensions(); - + $atomClass = Reader\Reader::getPluginLoader()->getClassName('Atom\\Feed'); $this->_extensions['Atom\\Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath); $atomClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Feed'); @@ -47,12 +47,12 @@ public function __construct(DOMElement $source, $xpathPrefix, $type = Reader\Rea $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source'); } } - + /** * Since this is not an Entry carrier but a vehicle for Feed metadata, any * applicable Entry methods are stubbed out and do nothing. */ - + /** * @return void */ @@ -62,7 +62,7 @@ public function count() {} * @return void */ public function current() {} - + /** * @return void */ @@ -77,12 +77,12 @@ public function next() {} * @return void */ public function rewind() {} - + /** * @return void */ public function valid() {} - + /** * @return void */ diff --git a/src/Reader/Feed/FeedInterface.php b/src/Reader/Feed/FeedInterface.php index 7da249ce..a1331a1f 100644 --- a/src/Reader/Feed/FeedInterface.php +++ b/src/Reader/Feed/FeedInterface.php @@ -103,7 +103,7 @@ public function getFeedLink(); * @return string|null */ public function getTitle(); - + /** * Get all categories * diff --git a/src/Reader/Feed/Rss.php b/src/Reader/Feed/Rss.php index db6f5a5f..96b16462 100644 --- a/src/Reader/Feed/Rss.php +++ b/src/Reader/Feed/Rss.php @@ -75,7 +75,7 @@ public function getAuthors() if (array_key_exists('authors', $this->_data)) { return $this->_data['authors']; } - + $authors = array(); $authors_dc = $this->getExtension('DublinCore')->getAuthors(); if (!empty($authors_dc)) { @@ -109,7 +109,7 @@ public function getAuthors() $data['name'] = $matches[1]; } $authors[] = $data; - } + } } } @@ -619,7 +619,7 @@ public function getHubs() return $this->_data['hubs']; } - + /** * Get all categories * @@ -650,7 +650,7 @@ public function getCategories() } else { $categoryCollection = $this->getExtension('DublinCore')->getCategories(); } - + if (count($categoryCollection) == 0) { $categoryCollection = $this->getExtension('Atom')->getCategories(); } diff --git a/src/Reader/FeedSet.php b/src/Reader/FeedSet.php index 7e9badb7..a73f5235 100644 --- a/src/Reader/FeedSet.php +++ b/src/Reader/FeedSet.php @@ -64,7 +64,7 @@ public function addLinks(DOMNodeList $links, $uri) )); } } - + /** * Attempt to turn a relative URI into an absolute URI */ @@ -87,7 +87,7 @@ protected function absolutiseUri($link, $uri = null) } return $link; } - + /** * Canonicalize relative path */ diff --git a/src/Writer/Deleted.php b/src/Writer/Deleted.php index 86cadfeb..29606a94 100644 --- a/src/Writer/Deleted.php +++ b/src/Writer/Deleted.php @@ -26,7 +26,7 @@ class Deleted * @var array */ protected $_data = array(); - + /** * Holds the value "atom" or "rss" depending on the feed type set when * when last exported. @@ -34,7 +34,7 @@ class Deleted * @var string */ protected $_type = null; - + /** * Set the feed character encoding * @@ -61,7 +61,7 @@ public function getEncoding() } return $this->_data['encoding']; } - + /** * Unset a specific data point * @@ -73,7 +73,7 @@ public function remove($name) unset($this->_data[$name]); } } - + /** * Set the current feed type being exported to "rss" or "atom". This allows * other objects to gracefully choose whether to execute or not, depending @@ -85,7 +85,7 @@ public function setType($type) { $this->_type = $type; } - + /** * Retrieve the current or last feed type exported. * @@ -109,7 +109,7 @@ public function setReference($reference) } $this->_data['reference'] = $reference; } - + public function getReference() { if (!array_key_exists('reference', $this->_data)) { @@ -157,8 +157,8 @@ public function getWhen() public function setBy(array $by) { $author = array(); - if (!array_key_exists('name', $by) - || empty($by['name']) + if (!array_key_exists('name', $by) + || empty($by['name']) || !is_string($by['name']) ) { throw new Exception\InvalidArgumentException('Invalid parameter: author array must include a' @@ -173,8 +173,8 @@ public function setBy(array $by) $author['email'] = $by['email']; } if (isset($by['uri'])) { - if (empty($by['uri']) - || !is_string($by['uri']) + if (empty($by['uri']) + || !is_string($by['uri']) || !Uri\UriFactory::factory($by['uri'])->isValid() ) { throw new Exception\InvalidArgumentException('Invalid parameter: "uri" array value must' @@ -184,7 +184,7 @@ public function setBy(array $by) } $this->_data['by'] = $author; } - + public function getBy() { if (!array_key_exists('by', $this->_data)) { @@ -192,12 +192,12 @@ public function getBy() } return $this->_data['by']; } - + public function setComment($comment) { $this->_data['comment'] = $comment; } - + public function getComment() { if (!array_key_exists('comment', $this->_data)) { diff --git a/src/Writer/Exception/InvalidArgumentException.php b/src/Writer/Exception/InvalidArgumentException.php index 787b309f..8df048f2 100644 --- a/src/Writer/Exception/InvalidArgumentException.php +++ b/src/Writer/Exception/InvalidArgumentException.php @@ -21,7 +21,7 @@ * @package Zend_Feed * @subpackage Writer */ -class InvalidArgumentException +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface {} diff --git a/src/Writer/Extension/AbstractRenderer.php b/src/Writer/Extension/AbstractRenderer.php index 6ed9938b..e7811149 100644 --- a/src/Writer/Extension/AbstractRenderer.php +++ b/src/Writer/Extension/AbstractRenderer.php @@ -23,32 +23,32 @@ abstract class AbstractRenderer implements Renderer * @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; - + /** * Encoding of all text values * @@ -58,19 +58,19 @@ abstract class AbstractRenderer implements Renderer /** * Constructor - * - * @param mixed $container + * + * @param mixed $container * @return void */ public function __construct($container) { $this->_container = $container; } - + /** * Set feed encoding - * - * @param string $enc + * + * @param string $enc * @return AbstractRenderer */ public function setEncoding($enc) @@ -78,20 +78,20 @@ public function setEncoding($enc) $this->_encoding = $enc; return $this; } - + /** * Get feed encoding - * + * * @return string */ public function getEncoding() { return $this->_encoding; } - + /** * Set DOMDocument and DOMElement on which to operate - * + * * @param DOMDocument $dom * @param DOMElement $base * @return AbstractRenderer @@ -102,21 +102,21 @@ public function setDomDocument(DOMDocument $dom, DOMElement $base) $this->_base = $base; return $this; } - + /** * Get data container being rendered - * + * * @return mixed */ public function getDataContainer() { return $this->_container; } - + /** * Set feed type - * - * @param string $type + * + * @param string $type * @return AbstractRenderer */ public function setType($type) @@ -124,21 +124,21 @@ 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 + * Set root element of document + * + * @param DOMElement $root * @return AbstractRenderer */ public function setRootElement(DOMElement $root) @@ -146,20 +146,20 @@ 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(); diff --git a/src/Writer/Extension/Atom/Renderer/Feed.php b/src/Writer/Extension/Atom/Renderer/Feed.php index 91a08b4f..a5b58ae0 100644 --- a/src/Writer/Extension/Atom/Renderer/Feed.php +++ b/src/Writer/Extension/Atom/Renderer/Feed.php @@ -29,10 +29,10 @@ class Feed extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render feed - * + * * @return void */ public function render() @@ -50,23 +50,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append namespaces to root element of feed - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:atom', - 'http://www.w3.org/2005/Atom'); + 'http://www.w3.org/2005/Atom'); } /** * Set feed link elements - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) @@ -85,12 +85,12 @@ protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) } $this->_called = true; } - + /** * Set PuSH hubs - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setHubs(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Extension/Content/Renderer/Entry.php b/src/Writer/Extension/Content/Renderer/Entry.php index 424112de..6eb611bb 100644 --- a/src/Writer/Extension/Content/Renderer/Entry.php +++ b/src/Writer/Extension/Content/Renderer/Entry.php @@ -29,10 +29,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -45,21 +45,21 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append namespaces to root element - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:content', - 'http://purl.org/rss/1.0/modules/content/'); + 'http://purl.org/rss/1.0/modules/content/'); } /** * Set entry content - * + * * @param DOMDocument $dom * @param DOMElement $root * @return void diff --git a/src/Writer/Extension/DublinCore/Renderer/Entry.php b/src/Writer/Extension/DublinCore/Renderer/Entry.php index 6f756c60..44dbb97e 100644 --- a/src/Writer/Extension/DublinCore/Renderer/Entry.php +++ b/src/Writer/Extension/DublinCore/Renderer/Entry.php @@ -29,10 +29,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -45,23 +45,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append namespaces to entry - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:dc', - 'http://purl.org/dc/elements/1.1/'); + 'http://purl.org/dc/elements/1.1/'); } /** * Set entry author elements - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -75,7 +75,7 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) if (array_key_exists('name', $data)) { $text = $dom->createTextNode($data['name']); $author->appendChild($text); - $root->appendChild($author); + $root->appendChild($author); } } $this->_called = true; diff --git a/src/Writer/Extension/DublinCore/Renderer/Feed.php b/src/Writer/Extension/DublinCore/Renderer/Feed.php index 81c9f056..5a2714fb 100644 --- a/src/Writer/Extension/DublinCore/Renderer/Feed.php +++ b/src/Writer/Extension/DublinCore/Renderer/Feed.php @@ -29,10 +29,10 @@ class Feed extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render feed - * + * * @return void */ public function render() @@ -45,23 +45,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append namespaces to feed element - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:dc', - 'http://purl.org/dc/elements/1.1/'); + 'http://purl.org/dc/elements/1.1/'); } /** * Set feed authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -75,7 +75,7 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) if (array_key_exists('name', $data)) { $text = $dom->createTextNode($data['name']); $author->appendChild($text); - $root->appendChild($author); + $root->appendChild($author); } } $this->_called = true; diff --git a/src/Writer/Extension/ITunes/Entry.php b/src/Writer/Extension/ITunes/Entry.php index d580f2af..84de093f 100644 --- a/src/Writer/Extension/ITunes/Entry.php +++ b/src/Writer/Extension/ITunes/Entry.php @@ -25,18 +25,18 @@ class Entry * @var array */ protected $_data = array(); - + /** * Encoding of all text values * * @var string */ protected $_encoding = 'UTF-8'; - + /** * Set feed encoding - * - * @param string $enc + * + * @param string $enc * @return Zend_Feed_Writer_Extension_ITunes_Entry */ public function setEncoding($enc) @@ -44,17 +44,17 @@ public function setEncoding($enc) $this->_encoding = $enc; return $this; } - + /** * Get feed encoding - * + * * @return string */ public function getEncoding() { return $this->_encoding; } - + /** * Set a block value of "yes" or "no". You may also set an empty string. * @@ -74,11 +74,11 @@ public function setItunesBlock($value) } $this->_data['block'] = $value; } - + /** * Add authors to itunes entry - * - * @param array $values + * + * @param array $values * @return Entry */ public function addItunesAuthors(array $values) @@ -88,11 +88,11 @@ public function addItunesAuthors(array $values) } return $this; } - + /** * Add author to itunes entry - * - * @param string $value + * + * @param string $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -105,14 +105,14 @@ public function addItunesAuthor($value) if (!isset($this->_data['authors'])) { $this->_data['authors'] = array(); } - $this->_data['authors'][] = $value; + $this->_data['authors'][] = $value; return $this; } - + /** * Set duration - * - * @param int $value + * + * @param int $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -129,11 +129,11 @@ public function setItunesDuration($value) $this->_data['duration'] = $value; return $this; } - + /** * Set "explicit" flag - * - * @param bool $value + * + * @param bool $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -146,11 +146,11 @@ public function setItunesExplicit($value) $this->_data['explicit'] = $value; return $this; } - + /** * Set keywords - * - * @param array $value + * + * @param array $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -169,11 +169,11 @@ public function setItunesKeywords(array $value) $this->_data['keywords'] = $value; return $this; } - + /** * Set subtitle - * - * @param string $value + * + * @param string $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -186,11 +186,11 @@ public function setItunesSubtitle($value) $this->_data['subtitle'] = $value; return $this; } - + /** * Set summary - * - * @param string $value + * + * @param string $value * @return Entry * @throws Writer\Exception\InvalidArgumentException */ @@ -203,12 +203,12 @@ public function setItunesSummary($value) $this->_data['summary'] = $value; return $this; } - + /** * Overloading to itunes specific setters - * - * @param string $method - * @param array $params + * + * @param string $method + * @param array $params * @return mixed */ public function __call($method, array $params) @@ -221,7 +221,7 @@ public function __call($method, array $params) 'invalid method: ' . $method ); } - if (!array_key_exists($point, $this->_data) + if (!array_key_exists($point, $this->_data) || empty($this->_data[$point]) ) { return null; diff --git a/src/Writer/Extension/ITunes/Feed.php b/src/Writer/Extension/ITunes/Feed.php index a369a4c4..08e6337d 100644 --- a/src/Writer/Extension/ITunes/Feed.php +++ b/src/Writer/Extension/ITunes/Feed.php @@ -25,18 +25,18 @@ class Feed * @var array */ protected $_data = array(); - + /** * Encoding of all text values * * @var string */ protected $_encoding = 'UTF-8'; - + /** * Set feed encoding - * - * @param string $enc + * + * @param string $enc * @return Feed */ public function setEncoding($enc) @@ -44,17 +44,17 @@ public function setEncoding($enc) $this->_encoding = $enc; return $this; } - + /** * Get feed encoding - * + * * @return string */ public function getEncoding() { return $this->_encoding; } - + /** * Set a block value of "yes" or "no". You may also set an empty string. * @@ -75,11 +75,11 @@ public function setItunesBlock($value) $this->_data['block'] = $value; return $this; } - + /** * Add feed authors - * - * @param array $values + * + * @param array $values * @return Feed */ public function addItunesAuthors(array $values) @@ -89,11 +89,11 @@ public function addItunesAuthors(array $values) } return $this; } - + /** * Add feed author - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -106,14 +106,14 @@ public function addItunesAuthor($value) if (!isset($this->_data['authors'])) { $this->_data['authors'] = array(); } - $this->_data['authors'][] = $value; + $this->_data['authors'][] = $value; return $this; } - + /** * Set feed categories - * - * @param array $values + * + * @param array $values * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -141,16 +141,16 @@ public function setItunesCategories(array $values) . ' contain a maximum of 255 characters each'); } $this->_data['categories'][$key][] = $val; - } + } } } return $this; } - + /** * Set feed image (icon) - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -168,11 +168,11 @@ public function setItunesImage($value) $this->_data['image'] = $value; return $this; } - + /** * Set feed cumulative duration - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -189,11 +189,11 @@ public function setItunesDuration($value) $this->_data['duration'] = $value; return $this; } - + /** * Set "explicit" flag - * - * @param bool $value + * + * @param bool $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -206,11 +206,11 @@ public function setItunesExplicit($value) $this->_data['explicit'] = $value; return $this; } - + /** * Set feed keywords - * - * @param array $value + * + * @param array $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -229,11 +229,11 @@ public function setItunesKeywords(array $value) $this->_data['keywords'] = $value; return $this; } - + /** * Set new feed URL - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -246,25 +246,25 @@ public function setItunesNewFeedUrl($value) $this->_data['newFeedUrl'] = $value; return $this; } - + /** * Add feed owners - * - * @param array $values + * + * @param array $values * @return Feed */ public function addItunesOwners(array $values) { foreach ($values as $value) { - $this->addItunesOwner($value); + $this->addItunesOwner($value); } return $this; } - + /** * Add feed owner - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -286,11 +286,11 @@ public function addItunesOwner(array $value) $this->_data['owners'][] = $value; return $this; } - + /** * Set feed subtitle - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -303,11 +303,11 @@ public function setItunesSubtitle($value) $this->_data['subtitle'] = $value; return $this; } - + /** * Set feed summary - * - * @param string $value + * + * @param string $value * @return Feed * @throws Writer\Exception\InvalidArgumentException */ @@ -320,12 +320,12 @@ public function setItunesSummary($value) $this->_data['summary'] = $value; return $this; } - + /** * Overloading: proxy to internal setters - * - * @param string $method - * @param array $params + * + * @param string $method + * @param array $params * @return mixed * @throws Writer\Exception\BadMethodCallException */ diff --git a/src/Writer/Extension/ITunes/Renderer/Entry.php b/src/Writer/Extension/ITunes/Renderer/Entry.php index 33410ceb..c91812ac 100644 --- a/src/Writer/Extension/ITunes/Renderer/Entry.php +++ b/src/Writer/Extension/ITunes/Renderer/Entry.php @@ -28,10 +28,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -47,23 +47,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append namespaces to entry root - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:itunes', - 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + 'http://www.itunes.com/dtds/podcast-1.0.dtd'); } /** * Set entry authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -80,12 +80,12 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) $this->_called = true; } } - + /** * Set itunes block - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBlock(DOMDocument $dom, DOMElement $root) @@ -100,12 +100,12 @@ protected function _setBlock(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set entry duration - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDuration(DOMDocument $dom, DOMElement $root) @@ -120,12 +120,12 @@ protected function _setDuration(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set explicit flag - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setExplicit(DOMDocument $dom, DOMElement $root) @@ -140,12 +140,12 @@ protected function _setExplicit(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set entry keywords - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setKeywords(DOMDocument $dom, DOMElement $root) @@ -160,12 +160,12 @@ protected function _setKeywords(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set entry subtitle - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setSubtitle(DOMDocument $dom, DOMElement $root) @@ -180,12 +180,12 @@ protected function _setSubtitle(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set entry summary - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setSummary(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Extension/ITunes/Renderer/Feed.php b/src/Writer/Extension/ITunes/Renderer/Feed.php index 32186a86..977c0192 100644 --- a/src/Writer/Extension/ITunes/Renderer/Feed.php +++ b/src/Writer/Extension/ITunes/Renderer/Feed.php @@ -20,7 +20,7 @@ */ class Feed extends Extension\AbstractRenderer { - + /** * Set to TRUE if a rendering method actually renders something. This * is used to prevent premature appending of a XML namespace declaration @@ -29,10 +29,10 @@ class Feed extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render feed - * + * * @return void */ public function render() @@ -52,23 +52,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append feed namespaces - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:itunes', - 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + 'http://www.itunes.com/dtds/podcast-1.0.dtd'); } /** * Set feed authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -85,12 +85,12 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) } $this->_called = true; } - + /** * Set feed itunes block - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBlock(DOMDocument $dom, DOMElement $root) @@ -105,12 +105,12 @@ protected function _setBlock(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set feed categories - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCategories(DOMDocument $dom, DOMElement $root) @@ -137,12 +137,12 @@ protected function _setCategories(DOMDocument $dom, DOMElement $root) } $this->_called = true; } - + /** * Set feed image (icon) - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setImage(DOMDocument $dom, DOMElement $root) @@ -156,12 +156,12 @@ protected function _setImage(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set feed cumulative duration - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDuration(DOMDocument $dom, DOMElement $root) @@ -176,12 +176,12 @@ protected function _setDuration(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set explicit flag - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setExplicit(DOMDocument $dom, DOMElement $root) @@ -196,12 +196,12 @@ protected function _setExplicit(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set feed keywords - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setKeywords(DOMDocument $dom, DOMElement $root) @@ -216,12 +216,12 @@ protected function _setKeywords(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set feed's new URL - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root) @@ -236,12 +236,12 @@ protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** - * Set feed owners - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set feed owners + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setOwners(DOMDocument $dom, DOMElement $root) @@ -264,12 +264,12 @@ protected function _setOwners(DOMDocument $dom, DOMElement $root) } $this->_called = true; } - + /** * Set feed subtitle - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setSubtitle(DOMDocument $dom, DOMElement $root) @@ -284,12 +284,12 @@ protected function _setSubtitle(DOMDocument $dom, DOMElement $root) $root->appendChild($el); $this->_called = true; } - + /** * Set feed summary - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setSummary(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Extension/Renderer.php b/src/Writer/Extension/Renderer.php index dcb40b3e..414d92e5 100644 --- a/src/Writer/Extension/Renderer.php +++ b/src/Writer/Extension/Renderer.php @@ -22,30 +22,30 @@ interface Renderer /** * Constructor * - * @param mixed $container + * @param mixed $container * @return void */ public function __construct($container); - + /** * Set DOMDocument and DOMElement on which to operate - * - * @param DOMDocument $dom - * @param DOMElement $base + * + * @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(); diff --git a/src/Writer/Extension/Slash/Renderer/Entry.php b/src/Writer/Extension/Slash/Renderer/Entry.php index 694ef070..d29c55e0 100644 --- a/src/Writer/Extension/Slash/Renderer/Entry.php +++ b/src/Writer/Extension/Slash/Renderer/Entry.php @@ -29,10 +29,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -45,23 +45,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append entry namespaces - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:slash', - 'http://purl.org/rss/1.0/modules/slash/'); + 'http://purl.org/rss/1.0/modules/slash/'); } /** * Set entry comment count - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentCount(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Extension/Threading/Renderer/Entry.php b/src/Writer/Extension/Threading/Renderer/Entry.php index 61bfa117..d1239010 100644 --- a/src/Writer/Extension/Threading/Renderer/Entry.php +++ b/src/Writer/Extension/Threading/Renderer/Entry.php @@ -29,10 +29,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -47,23 +47,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append entry namespaces - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:thr', - 'http://purl.org/syndication/thread/1.0'); + 'http://purl.org/syndication/thread/1.0'); } - + /** * Set comment link - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentLink(DOMDocument $dom, DOMElement $root) @@ -83,12 +83,12 @@ protected function _setCommentLink(DOMDocument $dom, DOMElement $root) $root->appendChild($clink); $this->_called = true; } - + /** * Set comment feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) @@ -113,9 +113,9 @@ protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) /** * Set entry comment count - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentCount(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php b/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php index 814d815e..9a2a7ca4 100644 --- a/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php +++ b/src/Writer/Extension/WellFormedWeb/Renderer/Entry.php @@ -29,10 +29,10 @@ class Entry extends Extension\AbstractRenderer * @var bool */ protected $_called = false; - + /** * Render entry - * + * * @return void */ public function render() @@ -45,23 +45,23 @@ public function render() $this->_appendNamespaces(); } } - + /** * Append entry namespaces - * + * * @return void */ protected function _appendNamespaces() { $this->getRootElement()->setAttribute('xmlns:wfw', - 'http://wellformedweb.org/CommentAPI/'); + 'http://wellformedweb.org/CommentAPI/'); } - + /** * Set entry comment feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Feed.php b/src/Writer/Feed.php index cfd2b3bf..0008911f 100644 --- a/src/Writer/Feed.php +++ b/src/Writer/Feed.php @@ -63,7 +63,7 @@ public function addTombstone(Deleted $deleted) { $this->_entries[] = $deleted; } - + /** * Creates a new Zend_Feed_Writer_Deleted data container for use. This is NOT * added to the current feed automatically, but is necessary to create a diff --git a/src/Writer/FeedFactory.php b/src/Writer/FeedFactory.php index ceb74448..2abc8bc3 100644 --- a/src/Writer/FeedFactory.php +++ b/src/Writer/FeedFactory.php @@ -21,7 +21,7 @@ abstract class FeedFactory { /** * Create and return a Feed based on data provided. - * + * * @param array|\Traversable $data * @return Feed */ @@ -73,8 +73,8 @@ public static function factory($data) /** * Normalize a key - * - * @param string $key + * + * @param string $key * @return string */ protected static function convertKey($key) @@ -85,9 +85,9 @@ protected static function convertKey($key) /** * Create and attach entries to a feed - * - * @param array|Traversable $entries - * @param Feed $feed + * + * @param array|Traversable $entries + * @param Feed $feed * @return void */ protected static function createEntries($entries, Feed $feed) diff --git a/src/Writer/Renderer/AbstractRenderer.php b/src/Writer/Renderer/AbstractRenderer.php index 1777ffcd..1760faf4 100644 --- a/src/Writer/Renderer/AbstractRenderer.php +++ b/src/Writer/Renderer/AbstractRenderer.php @@ -25,7 +25,7 @@ class AbstractRenderer * @var array */ protected $_extensions = array(); - + /** * @var mixed */ @@ -45,14 +45,14 @@ class AbstractRenderer * @var array */ protected $_exceptions = array(); - + /** * Encoding of all text values * * @var string */ protected $_encoding = 'UTF-8'; - + /** * Holds the value "atom" or "rss" depending on the feed type set when * when last exported. @@ -60,7 +60,7 @@ class AbstractRenderer * @var string */ protected $_type = null; - + /** * @var DOMElement */ @@ -68,8 +68,8 @@ class AbstractRenderer /** * Constructor - * - * @param mixed $container + * + * @param mixed $container * @return void */ public function __construct($container) @@ -78,10 +78,10 @@ public function __construct($container) $this->setType($container->getType()); $this->_loadExtensions(); } - + /** * Save XML to string - * + * * @return string */ public function saveXml() @@ -91,7 +91,7 @@ public function saveXml() /** * Get DOM document - * + * * @return DOMDocument */ public function getDomDocument() @@ -101,7 +101,7 @@ public function getDomDocument() /** * Get document element from DOM - * + * * @return DOMElement */ public function getElement() @@ -111,18 +111,18 @@ public function getElement() /** * Get data container of items being rendered - * + * * @return mixed */ public function getDataContainer() { return $this->_container; } - + /** * Set feed encoding - * - * @param string $enc + * + * @param string $enc * @return AbstractRenderer */ public function setEncoding($enc) @@ -130,10 +130,10 @@ public function setEncoding($enc) $this->_encoding = $enc; return $this; } - + /** * Get feed encoding - * + * * @return string */ public function getEncoding() @@ -143,8 +143,8 @@ public function getEncoding() /** * Indicate whether or not to ignore exceptions - * - * @param bool $bool + * + * @param bool $bool * @return AbstractRenderer * @throws Writer\Exception\InvalidArgumentException */ @@ -159,14 +159,14 @@ public function ignoreExceptions($bool = true) /** * Get exception list - * + * * @return array */ public function getExceptions() { return $this->_exceptions; } - + /** * Set the current feed type being exported to "rss" or "atom". This allows * other objects to gracefully choose whether to execute or not, depending @@ -178,7 +178,7 @@ public function setType($type) { $this->_type = $type; } - + /** * Retrieve the current or last feed type exported. * @@ -188,7 +188,7 @@ public function getType() { return $this->_type; } - + /** * Sets the absolute root element for the XML feed being generated. This * helps simplify the appending of namespace declarations, but also ensures @@ -201,7 +201,7 @@ public function setRootElement(DOMElement $root) { $this->_rootElement = $root; } - + /** * Retrieve the absolute root element for the XML feed being generated. * @@ -211,7 +211,7 @@ public function getRootElement() { return $this->_rootElement; } - + /** * Load extensions from Zend_Feed_Writer * diff --git a/src/Writer/Renderer/Entry/Atom/Deleted.php b/src/Writer/Renderer/Entry/Atom/Deleted.php index 5e79189b..dd07abee 100644 --- a/src/Writer/Renderer/Entry/Atom/Deleted.php +++ b/src/Writer/Renderer/Entry/Atom/Deleted.php @@ -24,8 +24,8 @@ class Deleted { /** * Constructor - * - * @param \Zend\Feed\Writer\Deleted $container + * + * @param \Zend\Feed\Writer\Deleted $container * @return void */ public function __construct (\Zend\Feed\Writer\Deleted $container) @@ -35,7 +35,7 @@ public function __construct (\Zend\Feed\Writer\Deleted $container) /** * Render atom entry - * + * * @return \Zend\Feed\Writer\Renderer\Entry\Atom */ public function render() @@ -44,21 +44,21 @@ public function render() $this->_dom->formatOutput = true; $entry = $this->_dom->createElement('at:deleted-entry'); $this->_dom->appendChild($entry); - + $entry->setAttribute('ref', $this->_container->getReference()); $entry->setAttribute('when', $this->_container->getWhen()->format(DateTime::ISO8601)); - + $this->_setBy($this->_dom, $entry); $this->_setComment($this->_dom, $entry); - + return $this; } - + /** * Set tombstone comment - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setComment(DOMDocument $dom, DOMElement $root) @@ -72,12 +72,12 @@ protected function _setComment(DOMDocument $dom, DOMElement $root) $cdata = $dom->createCDATASection($this->getDataContainer()->getComment()); $c->appendChild($cdata); } - + /** - * Set entry authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBy(DOMDocument $dom, DOMElement $root) @@ -105,5 +105,5 @@ protected function _setBy(DOMDocument $dom, DOMElement $root) $uri->appendChild($text); } } - + } diff --git a/src/Writer/Renderer/Entry/AtomDeleted.php b/src/Writer/Renderer/Entry/AtomDeleted.php index 1ac0e1fb..573540d5 100644 --- a/src/Writer/Renderer/Entry/AtomDeleted.php +++ b/src/Writer/Renderer/Entry/AtomDeleted.php @@ -24,7 +24,7 @@ class AtomDeleted extends Renderer\AbstractRenderer implements Renderer\Renderer { /** * Constructor - * + * * @param Writer\Deleted $container * @return void */ @@ -44,21 +44,21 @@ public function render() $this->_dom->formatOutput = true; $entry = $this->_dom->createElement('at:deleted-entry'); $this->_dom->appendChild($entry); - + $entry->setAttribute('ref', $this->_container->getReference()); $entry->setAttribute('when', $this->_container->getWhen()->format(DateTime::ISO8601)); - + $this->_setBy($this->_dom, $entry); $this->_setComment($this->_dom, $entry); - + return $this; } - + /** * Set tombstone comment - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setComment(DOMDocument $dom, DOMElement $root) @@ -72,12 +72,12 @@ protected function _setComment(DOMDocument $dom, DOMElement $root) $cdata = $dom->createCDATASection($this->getDataContainer()->getComment()); $c->appendChild($cdata); } - + /** - * Set entry authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBy(DOMDocument $dom, DOMElement $root) @@ -105,5 +105,5 @@ protected function _setBy(DOMDocument $dom, DOMElement $root) $uri->appendChild($text); } } - + } diff --git a/src/Writer/Renderer/Entry/Rss.php b/src/Writer/Renderer/Entry/Rss.php index b993af64..83d1dc49 100644 --- a/src/Writer/Renderer/Entry/Rss.php +++ b/src/Writer/Renderer/Entry/Rss.php @@ -25,7 +25,7 @@ class Rss extends Renderer\AbstractRenderer implements Renderer\RendererInterfac { /** * Constructor - * + * * @param Writer\Entry $container * @return void */ @@ -33,10 +33,10 @@ public function __construct (Writer\Entry $container) { parent::__construct($container); } - + /** * Render RSS entry - * + * * @return Rss */ public function render() @@ -46,7 +46,7 @@ public function render() $this->_dom->substituteEntities = false; $entry = $this->_dom->createElement('item'); $this->_dom->appendChild($entry); - + $this->_setTitle($this->_dom, $entry); $this->_setDescription($this->_dom, $entry); $this->_setDateCreated($this->_dom, $entry); @@ -66,12 +66,12 @@ public function render() return $this; } - + /** * Set entry title - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -95,10 +95,10 @@ protected function _setTitle(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($this->getDataContainer()->getTitle()); $title->appendChild($text); } - + /** * Set entry description - * + * * @param DOMDocument $dom * @param DOMElement $root * @return void @@ -128,12 +128,12 @@ protected function _setDescription(DOMDocument $dom, DOMElement $root) $text = $dom->createCDATASection($this->getDataContainer()->getDescription()); $subtitle->appendChild($text); } - + /** * Set date entry was last modified - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateModified(DOMDocument $dom, DOMElement $root) @@ -149,12 +149,12 @@ protected function _setDateModified(DOMDocument $dom, DOMElement $root) ); $updated->appendChild($text); } - + /** * Set date entry was created - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) @@ -168,12 +168,12 @@ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) ); } } - + /** * Set entry authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -193,12 +193,12 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) $root->appendChild($author); } } - + /** * Set entry enclosure - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -242,12 +242,12 @@ protected function _setEnclosure(DOMDocument $dom, DOMElement $root) $enclosure->setAttribute('url', $data['uri']); $root->appendChild($enclosure); } - + /** * Set link to entry - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLink(DOMDocument $dom, DOMElement $root) @@ -260,12 +260,12 @@ protected function _setLink(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($this->getDataContainer()->getLink()); $link->appendChild($text); } - + /** * Set entry identifier - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setId(DOMDocument $dom, DOMElement $root) @@ -287,12 +287,12 @@ protected function _setId(DOMDocument $dom, DOMElement $root) $id->setAttribute('isPermaLink', 'false'); } } - + /** * Set link to entry comments - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCommentLink(DOMDocument $dom, DOMElement $root) @@ -306,12 +306,12 @@ protected function _setCommentLink(DOMDocument $dom, DOMElement $root) $clink->appendChild($text); $root->appendChild($clink); } - + /** * Set entry categories - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCategories(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Renderer/Feed/AbstractAtom.php b/src/Writer/Renderer/Feed/AbstractAtom.php index 7d31b9a6..ad069891 100644 --- a/src/Writer/Renderer/Feed/AbstractAtom.php +++ b/src/Writer/Renderer/Feed/AbstractAtom.php @@ -24,8 +24,8 @@ class AbstractAtom extends Renderer\AbstractRenderer { /** * Constructor - * - * @param Zend_Feed_Writer_Feed $container + * + * @param Zend_Feed_Writer_Feed $container * @return void */ public function __construct ($container) @@ -35,9 +35,9 @@ public function __construct ($container) /** * Set feed language - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLanguage(DOMDocument $dom, DOMElement $root) @@ -50,9 +50,9 @@ protected function _setLanguage(DOMDocument $dom, DOMElement $root) /** * Set feed title - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -79,9 +79,9 @@ protected function _setTitle(DOMDocument $dom, DOMElement $root) /** * Set feed description - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDescription(DOMDocument $dom, DOMElement $root) @@ -98,9 +98,9 @@ protected function _setDescription(DOMDocument $dom, DOMElement $root) /** * Set date feed was last modified - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -128,9 +128,9 @@ protected function _setDateModified(DOMDocument $dom, DOMElement $root) /** * Set feed generator string - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setGenerator(DOMDocument $dom, DOMElement $root) @@ -155,9 +155,9 @@ protected function _setGenerator(DOMDocument $dom, DOMElement $root) /** * Set link to feed - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLink(DOMDocument $dom, DOMElement $root) @@ -174,9 +174,9 @@ protected function _setLink(DOMDocument $dom, DOMElement $root) /** * Set feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -206,12 +206,12 @@ protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) $flink->setAttribute('href', $href); } } - + /** - * Set feed authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -249,9 +249,9 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) /** * Set feed identifier - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -281,12 +281,12 @@ protected function _setId(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($this->getDataContainer()->getId()); $id->appendChild($text); } - + /** * Set feed copyright - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCopyright(DOMDocument $dom, DOMElement $root) @@ -303,9 +303,9 @@ protected function _setCopyright(DOMDocument $dom, DOMElement $root) /** * Set feed level logo (image) - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setImage(DOMDocument $dom, DOMElement $root) @@ -319,12 +319,12 @@ protected function _setImage(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($image['uri']); $img->appendChild($text); } - + /** - * Set date feed was created - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set date feed was created + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) @@ -338,12 +338,12 @@ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) ); } } - + /** * Set base URL to feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) @@ -354,12 +354,12 @@ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) } $root->setAttribute('xml:base', $baseUrl); } - + /** - * Set hubs to which this feed pushes - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set hubs to which this feed pushes + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setHubs(DOMDocument $dom, DOMElement $root) @@ -375,12 +375,12 @@ protected function _setHubs(DOMDocument $dom, DOMElement $root) $root->appendChild($hub); } } - + /** - * Set feed cateories - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set feed cateories + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCategories(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Renderer/Feed/Atom.php b/src/Writer/Renderer/Feed/Atom.php index aa687fd6..54c85360 100644 --- a/src/Writer/Renderer/Feed/Atom.php +++ b/src/Writer/Renderer/Feed/Atom.php @@ -22,7 +22,7 @@ class Atom extends AbstractAtom implements Renderer\RendererInterface { /** * Constructor - * + * * @param Writer\Feed $container * @return void */ @@ -33,7 +33,7 @@ public function __construct (Writer\Feed $container) /** * Render Atom feed - * + * * @return Atom */ public function render() @@ -63,14 +63,14 @@ public function render() $this->_setCopyright($this->_dom, $root); $this->_setCategories($this->_dom, $root); $this->_setHubs($this->_dom, $root); - + foreach ($this->_extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); $ext->setDOMDocument($this->getDOMDocument(), $root); $ext->render(); } - + foreach ($this->_container as $entry) { if ($this->getDataContainer()->getEncoding()) { $entry->setEncoding($this->getDataContainer()->getEncoding()); diff --git a/src/Writer/Renderer/Feed/Atom/AbstractAtom.php b/src/Writer/Renderer/Feed/Atom/AbstractAtom.php index 70f5a571..57b65cfa 100644 --- a/src/Writer/Renderer/Feed/Atom/AbstractAtom.php +++ b/src/Writer/Renderer/Feed/Atom/AbstractAtom.php @@ -23,8 +23,8 @@ class AbstractAtom extends Feed\Writer\Renderer\AbstractRenderer { /** * Constructor - * - * @param \Zend\Feed\Writer\Feed $container + * + * @param \Zend\Feed\Writer\Feed $container * @return void */ public function __construct ($container) @@ -34,9 +34,9 @@ public function __construct ($container) /** * Set feed language - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLanguage(DOMDocument $dom, DOMElement $root) @@ -49,9 +49,9 @@ protected function _setLanguage(DOMDocument $dom, DOMElement $root) /** * Set feed title - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Feed\Exception\InvalidArgumentException */ @@ -78,9 +78,9 @@ protected function _setTitle(DOMDocument $dom, DOMElement $root) /** * Set feed description - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDescription(DOMDocument $dom, DOMElement $root) @@ -97,9 +97,9 @@ protected function _setDescription(DOMDocument $dom, DOMElement $root) /** * Set date feed was last modified - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Feed\Exception\InvalidArgumentException */ @@ -127,9 +127,9 @@ protected function _setDateModified(DOMDocument $dom, DOMElement $root) /** * Set feed generator string - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setGenerator(DOMDocument $dom, DOMElement $root) @@ -154,9 +154,9 @@ protected function _setGenerator(DOMDocument $dom, DOMElement $root) /** * Set link to feed - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLink(DOMDocument $dom, DOMElement $root) @@ -173,9 +173,9 @@ protected function _setLink(DOMDocument $dom, DOMElement $root) /** * Set feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Feed\Exception\InvalidArgumentException */ @@ -205,12 +205,12 @@ protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) $flink->setAttribute('href', $href); } } - + /** - * Set feed authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -248,9 +248,9 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) /** * Set feed identifier - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Feed\Exception\InvalidArgumentException */ @@ -280,12 +280,12 @@ protected function _setId(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($this->getDataContainer()->getId()); $id->appendChild($text); } - + /** * Set feed copyright - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCopyright(DOMDocument $dom, DOMElement $root) @@ -301,9 +301,9 @@ protected function _setCopyright(DOMDocument $dom, DOMElement $root) } /** * Set feed level logo (image) - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setImage(DOMDocument $dom, DOMElement $root) @@ -317,13 +317,13 @@ protected function _setImage(DOMDocument $dom, DOMElement $root) $text = $dom->createTextNode($image['uri']); $img->appendChild($text); } - - + + /** - * Set date feed was created - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set date feed was created + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) @@ -337,12 +337,12 @@ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) ); } } - + /** * Set base URL to feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) @@ -353,12 +353,12 @@ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) } $root->setAttribute('xml:base', $baseUrl); } - + /** - * Set hubs to which this feed pushes - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set hubs to which this feed pushes + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setHubs(DOMDocument $dom, DOMElement $root) @@ -374,12 +374,12 @@ protected function _setHubs(DOMDocument $dom, DOMElement $root) $root->appendChild($hub); } } - + /** - * Set feed cateories - * - * @param DOMDocument $dom - * @param DOMElement $root + * Set feed cateories + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCategories(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Renderer/Feed/Atom/Source.php b/src/Writer/Renderer/Feed/Atom/Source.php index 1f934013..5950f328 100644 --- a/src/Writer/Renderer/Feed/Atom/Source.php +++ b/src/Writer/Renderer/Feed/Atom/Source.php @@ -22,7 +22,7 @@ class Source extends AbstractAtom implements \Zend\Feed\Writer\Renderer\Renderer /** * Constructor - * + * * @param \Zend\Feed\Writer\Source $container * @return void */ @@ -30,10 +30,10 @@ public function __construct (\Zend\Feed\Writer\Source $container) { parent::__construct($container); } - + /** * Render Atom Feed Metadata (Source element) - * + * * @return \Zend\Feed\Writer\Renderer\Feed\Atom */ public function render() @@ -59,7 +59,7 @@ public function render() $this->_setAuthors($this->_dom, $root); $this->_setCopyright($this->_dom, $root); $this->_setCategories($this->_dom, $root); - + foreach ($this->_extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); @@ -68,12 +68,12 @@ public function render() } return $this; } - + /** * Set feed generator string - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setGenerator(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Renderer/Feed/AtomSource.php b/src/Writer/Renderer/Feed/AtomSource.php index f0659403..d54fac86 100644 --- a/src/Writer/Renderer/Feed/AtomSource.php +++ b/src/Writer/Renderer/Feed/AtomSource.php @@ -24,18 +24,18 @@ class AtomSource extends AbstractAtom implements Renderer\RendererInterface /** * Constructor - * - * @param Zend_Feed_Writer_Feed_Source $container + * + * @param Zend_Feed_Writer_Feed_Source $container * @return void */ public function __construct (Writer\Source $container) { parent::__construct($container); } - + /** * Render Atom Feed Metadata (Source element) - * + * * @return \Zend\Feed\Writer\Renderer\Feed\Atom */ public function render() @@ -61,7 +61,7 @@ public function render() $this->_setAuthors($this->_dom, $root); $this->_setCopyright($this->_dom, $root); $this->_setCategories($this->_dom, $root); - + foreach ($this->_extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); @@ -70,10 +70,10 @@ public function render() } return $this; } - + /** * Set feed generator string - * + * * @param DOMDocument $dom * @param DOMElement $root * @return void diff --git a/src/Writer/Renderer/Feed/Rss.php b/src/Writer/Renderer/Feed/Rss.php index a154f180..ce571f53 100644 --- a/src/Writer/Renderer/Feed/Rss.php +++ b/src/Writer/Renderer/Feed/Rss.php @@ -25,8 +25,8 @@ class Rss extends Renderer\AbstractRenderer implements Renderer\RendererInterfac { /** * Constructor - * - * @param Zend_Feed_Writer_Feed $container + * + * @param Zend_Feed_Writer_Feed $container * @return void */ public function __construct (Writer\Feed $container) @@ -36,7 +36,7 @@ public function __construct (Writer\Feed $container) /** * Render RSS feed - * + * * @return Zend_Feed_Writer_Renderer_Feed_Rss */ public function render() @@ -50,7 +50,7 @@ public function render() $rss = $this->_dom->createElement('rss'); $this->setRootElement($rss); $rss->setAttribute('version', '2.0'); - + $channel = $this->_dom->createElement('channel'); $rss->appendChild($channel); $this->_dom->appendChild($rss); @@ -67,14 +67,14 @@ public function render() $this->_setAuthors($this->_dom, $channel); $this->_setCopyright($this->_dom, $channel); $this->_setCategories($this->_dom, $channel); - + foreach ($this->_extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); $ext->setDOMDocument($this->getDOMDocument(), $channel); $ext->render(); } - + foreach ($this->_container as $entry) { if ($this->getDataContainer()->getEncoding()) { $entry->setEncoding($this->getDataContainer()->getEncoding()); @@ -99,9 +99,9 @@ public function render() /** * Set feed language - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLanguage(DOMDocument $dom, DOMElement $root) @@ -117,9 +117,9 @@ protected function _setLanguage(DOMDocument $dom, DOMElement $root) /** * Set feed title - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -145,9 +145,9 @@ protected function _setTitle(DOMDocument $dom, DOMElement $root) /** * Set feed description - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -172,9 +172,9 @@ protected function _setDescription(DOMDocument $dom, DOMElement $root) /** * Set date feed was last modified - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateModified(DOMDocument $dom, DOMElement $root) @@ -193,9 +193,9 @@ protected function _setDateModified(DOMDocument $dom, DOMElement $root) /** * Set feed generator string - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setGenerator(DOMDocument $dom, DOMElement $root) @@ -221,9 +221,9 @@ protected function _setGenerator(DOMDocument $dom, DOMElement $root) /** * Set link to feed - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -249,12 +249,12 @@ protected function _setLink(DOMDocument $dom, DOMElement $root) $link->setAttribute('isPermaLink', 'false'); } } - + /** * Set feed authors - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setAuthors(DOMDocument $dom, DOMElement $root) @@ -274,12 +274,12 @@ protected function _setAuthors(DOMDocument $dom, DOMElement $root) $root->appendChild($author); } } - + /** * Set feed copyright - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCopyright(DOMDocument $dom, DOMElement $root) @@ -296,9 +296,9 @@ protected function _setCopyright(DOMDocument $dom, DOMElement $root) /** * Set feed channel image - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void * @throws Writer\Exception\InvalidArgumentException */ @@ -407,12 +407,12 @@ protected function _setImage(DOMDocument $dom, DOMElement $root) $img->appendChild($desc); } } - + /** * Set date feed was created - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) @@ -429,9 +429,9 @@ protected function _setDateCreated(DOMDocument $dom, DOMElement $root) /** * Set date feed last build date - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setLastBuildDate(DOMDocument $dom, DOMElement $root) @@ -447,12 +447,12 @@ protected function _setLastBuildDate(DOMDocument $dom, DOMElement $root) ); $lastBuildDate->appendChild($text); } - + /** * Set base URL to feed links - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) @@ -463,12 +463,12 @@ protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) } $root->setAttribute('xml:base', $baseUrl); } - + /** * Set feed categories - * - * @param DOMDocument $dom - * @param DOMElement $root + * + * @param DOMDocument $dom + * @param DOMElement $root * @return void */ protected function _setCategories(DOMDocument $dom, DOMElement $root) diff --git a/src/Writer/Renderer/RendererInterface.php b/src/Writer/Renderer/RendererInterface.php index 842492cc..3ef55a6c 100644 --- a/src/Writer/Renderer/RendererInterface.php +++ b/src/Writer/Renderer/RendererInterface.php @@ -21,53 +21,53 @@ interface 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(); - + /** * Set the current feed type being exported to "rss" or "atom". This allows * other objects to gracefully choose whether to execute or not, depending @@ -76,14 +76,14 @@ public function getExceptions(); * @param string $type */ public function setType($type); - + /** * Retrieve the current or last feed type exported. * * @return string Value will be "rss" or "atom" */ public function getType(); - + /** * Sets the absolute root element for the XML feed being generated. This * helps simplify the appending of namespace declarations, but also ensures @@ -93,7 +93,7 @@ public function getType(); * @param DOMElement $root */ public function setRootElement(DOMElement $root); - + /** * Retrieve the absolute root element for the XML feed being generated. * diff --git a/src/Writer/Writer.php b/src/Writer/Writer.php index 3d47bd70..803ba274 100644 --- a/src/Writer/Writer.php +++ b/src/Writer/Writer.php @@ -47,7 +47,7 @@ class Writer const TYPE_RSS_10 = 'rss-10'; const TYPE_RSS_20 = 'rss-20'; const TYPE_RSS_ANY = 'rss'; - + /** * PluginLoader instance used by component * @@ -75,7 +75,7 @@ class Writer 'entryRenderer' => array(), 'feedRenderer' => array(), ); - + /** * Set plugin loader for use with Extensions * @@ -254,7 +254,7 @@ public static function registerCoreExtensions() self::registerExtension('Threading'); self::registerExtension('ITunes'); } - + public static function lcfirst($str) { $str[0] = strtolower($str[0]); diff --git a/test/PubSubHubbub/Model/SubscriptionTest.php b/test/PubSubHubbub/Model/SubscriptionTest.php index 0d22ad0d..e1cd2129 100644 --- a/test/PubSubHubbub/Model/SubscriptionTest.php +++ b/test/PubSubHubbub/Model/SubscriptionTest.php @@ -32,9 +32,9 @@ public function testAllOperations() { $adapter = $this->initDb(); $table = new TableGateway('subscription', $adapter); - + $subscription = new Subscription($table); - + $id = uniqid(); $this->assertFalse($subscription->hasSubscription($id)); $this->assertFalse($subscription->getSubscription($id)); @@ -78,7 +78,7 @@ protected function initDb() } $db = new DbAdapter(array('driver' => 'pdo_sqlite', 'dsn' => 'sqlite::memory:')); $this->createTable($db); - + return $db; } diff --git a/test/PubSubHubbub/PublisherTest.php b/test/PubSubHubbub/PublisherTest.php index 16d3ef13..2d9d0545 100644 --- a/test/PubSubHubbub/PublisherTest.php +++ b/test/PubSubHubbub/PublisherTest.php @@ -299,7 +299,8 @@ public function testNotifiesHubAndReportsFail() class ClientNotReset extends HttpClient { - public function resetParameters($clearCookies = false) { + public function resetParameters($clearCookies = false) + { // Do nothing } } diff --git a/test/PubSubHubbub/SubscriberHttpTest.php b/test/PubSubHubbub/SubscriberHttpTest.php index 585183c7..7562181b 100644 --- a/test/PubSubHubbub/SubscriberHttpTest.php +++ b/test/PubSubHubbub/SubscriberHttpTest.php @@ -59,7 +59,7 @@ public function setUp() $this->_client->setAdapter('\Zend\Http\Client\Adapter\Socket'); PubSubHubbub::setHttpClient($this->_client); $this->_subscriber = new Subscriber; - + $this->_storage = $this->_getCleanMock('\Zend\Feed\PubSubHubbub\Model\Subscription'); $this->_subscriber->setStorage($this->_storage); @@ -98,8 +98,9 @@ public function testUnsubscriptionRequestSendsExpectedPostData() .'&hub.verify_token=abc', $this->_client->getResponse()->getBody()); } - - protected function _getCleanMock($className) { + + protected function _getCleanMock($className) + { $class = new \ReflectionClass($className); $methods = $class->getMethods(); $stubMethods = array(); diff --git a/test/PubSubHubbub/SubscriberTest.php b/test/PubSubHubbub/SubscriberTest.php index 20548f65..26d11928 100644 --- a/test/PubSubHubbub/SubscriberTest.php +++ b/test/PubSubHubbub/SubscriberTest.php @@ -26,9 +26,9 @@ class SubscriberTest extends \PHPUnit_Framework_TestCase { /** @var Subscriber */ protected $_subscriber = null; - + protected $_adapter = null; - + protected $_tableGateway = null; public function setUp() @@ -289,8 +289,9 @@ public function testGetStorageThrowsExceptionIfNoneSet() $this->setExpectedException('Zend\Feed\PubSubHubbub\Exception\ExceptionInterface'); $this->_subscriber->getStorage(); } - - protected function _getCleanMock($className) { + + protected function _getCleanMock($className) + { $class = new \ReflectionClass($className); $methods = $class->getMethods(); $stubMethods = array(); diff --git a/test/Reader/Entry/AtomStandaloneEntryTest.php b/test/Reader/Entry/AtomStandaloneEntryTest.php index 12de7ece..a5beb8e9 100644 --- a/test/Reader/Entry/AtomStandaloneEntryTest.php +++ b/test/Reader/Entry/AtomStandaloneEntryTest.php @@ -24,9 +24,9 @@ class AtomStandaloneEntryTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_expectedCats = array(); - + protected $_expectedCatsDc = array(); public function setup() @@ -186,7 +186,7 @@ public function testGetsEnclosureFromAtom10() $this->assertEquals($expected, $entry->getEnclosure()); } - + /** * TEXT * @group ZFRATOMCONTENT @@ -198,7 +198,7 @@ public function testGetsContentFromAtom10() ); $this->assertEquals('Entry Content &', $entry->getContent()); } - + /** * HTML Escaped * @group ZFRATOMCONTENT @@ -210,7 +210,7 @@ public function testGetsContentFromAtom10Html() ); $this->assertEquals('

Entry Content &

', $entry->getContent()); } - + /** * HTML CDATA Escaped * @group ZFRATOMCONTENT @@ -222,7 +222,7 @@ public function testGetsContentFromAtom10HtmlCdata() ); $this->assertEquals('

Entry Content &

', $entry->getContent()); } - + /** * XHTML * @group ZFRATOMCONTENT @@ -258,7 +258,7 @@ public function testGetsCommentLinkFromAtom10() ); $this->assertEquals('http://www.example.com/entry/comments', $entry->getCommentLink()); } - + /** * Get category data * @group ZFR002 @@ -271,5 +271,5 @@ public function testGetsCategoriesFromAtom10() $this->assertEquals($this->_expectedCats, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + } diff --git a/test/Reader/Entry/AtomTest.php b/test/Reader/Entry/AtomTest.php index 581215ec..a59f4ef2 100644 --- a/test/Reader/Entry/AtomTest.php +++ b/test/Reader/Entry/AtomTest.php @@ -24,9 +24,9 @@ class AtomTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_expectedCats = array(); - + protected $_expectedCatsDc = array(); public function setup() @@ -293,7 +293,7 @@ public function testGetsContentFromAtom10() $entry = $feed->current(); $this->assertEquals('Entry Content &', $entry->getContent()); } - + /** * HTML Escaped * @group ZFRATOMCONTENT @@ -306,7 +306,7 @@ public function testGetsContentFromAtom10Html() $entry = $feed->current(); $this->assertEquals('

Entry Content &

', $entry->getContent()); } - + /** * HTML CDATA Escaped * @group ZFRATOMCONTENT @@ -319,7 +319,7 @@ public function testGetsContentFromAtom10HtmlCdata() $entry = $feed->current(); $this->assertEquals('

Entry Content &

', $entry->getContent()); } - + /** * XHTML * @group ZFRATOMCONTENT @@ -422,13 +422,13 @@ public function testGetsCommentLinkFromAtom10_RelativeLinks() $entry = $feed->current(); $this->assertEquals('http://www.example.com/entry/comments', $entry->getCommentLink()); } - + /** * Get category data */ - + // Atom 1.0 (Atom 0.3 never supported categories except via Atom 1.0/Dublin Core extensions) - + public function testGetsCategoriesFromAtom10() { $feed = Reader\Reader::importString( @@ -438,7 +438,7 @@ public function testGetsCategoriesFromAtom10() $this->assertEquals($this->_expectedCats, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_Atom10Extension() { $feed = Reader\Reader::importString( @@ -448,9 +448,9 @@ public function testGetsCategoriesFromAtom03_Atom10Extension() $this->assertEquals($this->_expectedCats, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + // DC 1.0/1.1 for Atom 0.3 - + public function testGetsCategoriesFromAtom03_Dc10() { $feed = Reader\Reader::importString( @@ -460,7 +460,7 @@ public function testGetsCategoriesFromAtom03_Dc10() $this->assertEquals($this->_expectedCatsDc, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_Dc11() { $feed = Reader\Reader::importString( @@ -470,9 +470,9 @@ public function testGetsCategoriesFromAtom03_Dc11() $this->assertEquals($this->_expectedCatsDc, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + // No Categories In Entry - + public function testGetsCategoriesFromAtom10_None() { $feed = Reader\Reader::importString( @@ -482,7 +482,7 @@ public function testGetsCategoriesFromAtom10_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_None() { $feed = Reader\Reader::importString( @@ -492,5 +492,5 @@ public function testGetsCategoriesFromAtom03_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + } diff --git a/test/Reader/Entry/CommonTest.php b/test/Reader/Entry/CommonTest.php index 73eee640..01ff20a0 100644 --- a/test/Reader/Entry/CommonTest.php +++ b/test/Reader/Entry/CommonTest.php @@ -96,7 +96,7 @@ public function testReturnsNullIfExtensionDoesNotExist() $entry = $feed->current(); $this->assertEquals(null, $entry->getExtension('Foo')); } - + /** * @group ZF-8213 */ @@ -108,7 +108,7 @@ public function testReturnsEncodingOfFeed() $entry = $feed->current(); $this->assertEquals('UTF-8', $entry->getEncoding()); } - + /** * @group ZF-8213 */ @@ -131,12 +131,12 @@ public function testFeedEntryCanDetectFeedType() ); $entry = $feed->current(); $stub = $this->getMockForAbstractClass( - 'Zend\Feed\Reader\Entry\AbstractEntry', + 'Zend\Feed\Reader\Entry\AbstractEntry', array($entry->getElement(), $entry->getId()) ); $this->assertEquals($entry->getType(), $stub->getType()); } - + /** * When passing a newly created DOMElement without any DOMDocument assigned */ @@ -148,7 +148,7 @@ public function testFeedEntryCanSetAnyType() $entry = $feed->current(); $domElement = new \DOMElement($entry->getElement()->tagName); $stub = $this->getMockForAbstractClass( - 'Zend\Feed\Reader\Entry\AbstractEntry', + 'Zend\Feed\Reader\Entry\AbstractEntry', array($domElement, $entry->getId()) ); $this->assertEquals($stub->getType(), Reader\Reader::TYPE_ANY); diff --git a/test/Reader/Entry/RssTest.php b/test/Reader/Entry/RssTest.php index bc78bd25..8df5a580 100644 --- a/test/Reader/Entry/RssTest.php +++ b/test/Reader/Entry/RssTest.php @@ -24,11 +24,11 @@ class RssTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_expectedCats = array(); - + protected $_expectedCatsRdf = array(); - + protected $_expectedCatsAtom = array(); public function setup() @@ -1869,7 +1869,8 @@ public function testGetsDateModified($path, $edate) $this->assertTrue($edate == $entry->getDateModified()); } - public function dateModifiedProvider() { + public function dateModifiedProvider() + { $iso = DateTime::createFromFormat(DateTime::ISO8601, '2009-03-07T08:03:50Z'); $us = DateTime::createFromFormat(DateTime::ISO8601, '2010-01-04T02:14:00-0600'); $rss = DateTime::createFromFormat(DateTime::RSS, 'Sun, 11 Jan 2009 09:55:59 GMT'); @@ -2544,13 +2545,13 @@ public function testGetsCommentFeedLinkFromRss090_None() $entry = $feed->current(); $this->assertEquals(null, $entry->getCommentFeedLink()); } - + /** * Get category data */ - + // RSS 2.0 - + public function testGetsCategoriesFromRss20() { $feed = Reader\Reader::importString( @@ -2560,9 +2561,9 @@ public function testGetsCategoriesFromRss20() $this->assertEquals($this->_expectedCats, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + // DC 1.0 - + public function testGetsCategoriesFromRss090_Dc10() { $feed = Reader\Reader::importString( @@ -2572,7 +2573,7 @@ public function testGetsCategoriesFromRss090_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Dc10() { $feed = Reader\Reader::importString( @@ -2582,7 +2583,7 @@ public function testGetsCategoriesFromRss091_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Dc10() { $feed = Reader\Reader::importString( @@ -2592,7 +2593,7 @@ public function testGetsCategoriesFromRss092_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Dc10() { $feed = Reader\Reader::importString( @@ -2602,7 +2603,7 @@ public function testGetsCategoriesFromRss093_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Dc10() { $feed = Reader\Reader::importString( @@ -2612,7 +2613,7 @@ public function testGetsCategoriesFromRss094_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Dc10() { $feed = Reader\Reader::importString( @@ -2622,9 +2623,9 @@ public function testGetsCategoriesFromRss10_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + // DC 1.1 - + public function testGetsCategoriesFromRss090_Dc11() { $feed = Reader\Reader::importString( @@ -2634,7 +2635,7 @@ public function testGetsCategoriesFromRss090_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Dc11() { $feed = Reader\Reader::importString( @@ -2644,7 +2645,7 @@ public function testGetsCategoriesFromRss091_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Dc11() { $feed = Reader\Reader::importString( @@ -2654,7 +2655,7 @@ public function testGetsCategoriesFromRss092_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Dc11() { $feed = Reader\Reader::importString( @@ -2664,7 +2665,7 @@ public function testGetsCategoriesFromRss093_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Dc11() { $feed = Reader\Reader::importString( @@ -2674,7 +2675,7 @@ public function testGetsCategoriesFromRss094_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Dc11() { $feed = Reader\Reader::importString( @@ -2684,9 +2685,9 @@ public function testGetsCategoriesFromRss10_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $entry->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($entry->getCategories()->getValues())); } - + // Atom 1.0 - + public function testGetsCategoriesFromRss090_Atom10() { $feed = Reader\Reader::importString( @@ -2696,7 +2697,7 @@ public function testGetsCategoriesFromRss090_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Atom10() { $feed = Reader\Reader::importString( @@ -2706,7 +2707,7 @@ public function testGetsCategoriesFromRss091_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Atom10() { $feed = Reader\Reader::importString( @@ -2716,7 +2717,7 @@ public function testGetsCategoriesFromRss092_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Atom10() { $feed = Reader\Reader::importString( @@ -2726,7 +2727,7 @@ public function testGetsCategoriesFromRss093_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Atom10() { $feed = Reader\Reader::importString( @@ -2736,7 +2737,7 @@ public function testGetsCategoriesFromRss094_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Atom10() { $feed = Reader\Reader::importString( @@ -2746,9 +2747,9 @@ public function testGetsCategoriesFromRss10_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $entry->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($entry->getCategories()->getValues())); } - + // No Categories In Entry - + public function testGetsCategoriesFromRss20_None() { $feed = Reader\Reader::importString( @@ -2758,7 +2759,7 @@ public function testGetsCategoriesFromRss20_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss090_None() { $feed = Reader\Reader::importString( @@ -2768,7 +2769,7 @@ public function testGetsCategoriesFromRss090_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_None() { $feed = Reader\Reader::importString( @@ -2778,7 +2779,7 @@ public function testGetsCategoriesFromRss091_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_None() { $feed = Reader\Reader::importString( @@ -2788,7 +2789,7 @@ public function testGetsCategoriesFromRss092_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_None() { $feed = Reader\Reader::importString( @@ -2798,7 +2799,7 @@ public function testGetsCategoriesFromRss093_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_None() { $feed = Reader\Reader::importString( @@ -2808,7 +2809,7 @@ public function testGetsCategoriesFromRss094_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_None() { $feed = Reader\Reader::importString( @@ -2818,6 +2819,6 @@ public function testGetsCategoriesFromRss10_None() $this->assertEquals(array(), (array) $entry->getCategories()); $this->assertEquals(array(), array_values($entry->getCategories()->getValues())); } - - + + } diff --git a/test/Reader/Feed/AtomSourceTest.php b/test/Reader/Feed/AtomSourceTest.php index aea52b04..0d4eecab 100644 --- a/test/Reader/Feed/AtomSourceTest.php +++ b/test/Reader/Feed/AtomSourceTest.php @@ -24,11 +24,11 @@ class AtomSourceTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_options = array(); - + protected $_expectedCats = array(); - + protected $_expectedCatsDc = array(); public function setup() @@ -72,7 +72,7 @@ public function testGetsSourceFromEntry() file_get_contents($this->_feedSamplePath.'/title/atom10.xml') ); $source = $feed->current()->getSource(); - $this->assertTrue($source instanceof Reader\Feed\Atom\Source); + $this->assertTrue($source instanceof Reader\Feed\Atom\Source); } /** @@ -245,7 +245,7 @@ public function testGetsFeedLinkFromAtom10() $source = $feed->current()->getSource(); $this->assertEquals('http://www.example.com/feed/atom', $source->getFeedLink()); } - + /** * Get Pubsubhubbub Hubs */ @@ -260,7 +260,7 @@ public function testGetsHubsFromAtom10() 'http://www.example.com/hub2' ), $source->getHubs()); } - + /** * Get category data */ diff --git a/test/Reader/Feed/AtomTest.php b/test/Reader/Feed/AtomTest.php index bd472580..168ea9c4 100644 --- a/test/Reader/Feed/AtomTest.php +++ b/test/Reader/Feed/AtomTest.php @@ -24,11 +24,11 @@ class AtomTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_options = array(); - + protected $_expectedCats = array(); - + protected $_expectedCatsDc = array(); public function setup() @@ -413,13 +413,13 @@ public function testCountableInterface() ); $this->assertEquals(0, count($feed)); } - + /** * Get category data */ - + // Atom 1.0 (Atom 0.3 never supported categories except via Atom 1.0/Dublin Core extensions) - + public function testGetsCategoriesFromAtom10() { $feed = Reader\Reader::importString( @@ -428,7 +428,7 @@ public function testGetsCategoriesFromAtom10() $this->assertEquals($this->_expectedCats, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_Atom10Extension() { $feed = Reader\Reader::importString( @@ -437,9 +437,9 @@ public function testGetsCategoriesFromAtom03_Atom10Extension() $this->assertEquals($this->_expectedCats, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + // DC 1.0/1.1 for Atom 0.3 - + public function testGetsCategoriesFromAtom03_Dc10() { $feed = Reader\Reader::importString( @@ -448,7 +448,7 @@ public function testGetsCategoriesFromAtom03_Dc10() $this->assertEquals($this->_expectedCatsDc, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_Dc11() { $feed = Reader\Reader::importString( @@ -457,9 +457,9 @@ public function testGetsCategoriesFromAtom03_Dc11() $this->assertEquals($this->_expectedCatsDc, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + // No Categories In Entry - + public function testGetsCategoriesFromAtom10_None() { $feed = Reader\Reader::importString( @@ -468,7 +468,7 @@ public function testGetsCategoriesFromAtom10_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromAtom03_None() { $feed = Reader\Reader::importString( diff --git a/test/Reader/Feed/CommonTest.php b/test/Reader/Feed/CommonTest.php index 1eed3408..d00f5e0d 100644 --- a/test/Reader/Feed/CommonTest.php +++ b/test/Reader/Feed/CommonTest.php @@ -88,7 +88,7 @@ public function testReturnsNullIfExtensionDoesNotExist() ); $this->assertEquals(null, $feed->getExtension('Foo')); } - + /** * @group ZF-8213 */ @@ -99,7 +99,7 @@ public function testReturnsEncodingOfFeed() ); $this->assertEquals('UTF-8', $feed->getEncoding()); } - + /** * @group ZF-8213 */ diff --git a/test/Reader/Feed/RssTest.php b/test/Reader/Feed/RssTest.php index 664d99d6..caf73e98 100644 --- a/test/Reader/Feed/RssTest.php +++ b/test/Reader/Feed/RssTest.php @@ -24,11 +24,11 @@ class RssTest extends \PHPUnit_Framework_TestCase { protected $_feedSamplePath = null; - + protected $_expectedCats = array(); - + protected $_expectedCatsRdf = array(); - + protected $_expectedCatsAtom = array(); public function setup() @@ -2104,7 +2104,8 @@ public function testGetsDateModified($path, $edate) $this->assertTrue($edate == $feed->getDateModified()); } - public function dateModifiedProvider() { + public function dateModifiedProvider() + { $iso = DateTime::createFromFormat(DateTime::ISO8601, '2009-03-07T08:03:50Z'); $us = DateTime::createFromFormat(DateTime::ISO8601, '2010-01-04T02:14:00-0600'); return array( @@ -2280,13 +2281,13 @@ public function testGetsHubsFromRss090_None() ); $this->assertEquals(null, $feed->getHubs()); } - + /** * Get category data */ - + // RSS 2.0 - + public function testGetsCategoriesFromRss20() { $feed = Reader\Reader::importString( @@ -2295,9 +2296,9 @@ public function testGetsCategoriesFromRss20() $this->assertEquals($this->_expectedCats, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + // DC 1.0 - + public function testGetsCategoriesFromRss090_Dc10() { $feed = Reader\Reader::importString( @@ -2306,7 +2307,7 @@ public function testGetsCategoriesFromRss090_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Dc10() { $feed = Reader\Reader::importString( @@ -2315,7 +2316,7 @@ public function testGetsCategoriesFromRss091_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Dc10() { $feed = Reader\Reader::importString( @@ -2324,7 +2325,7 @@ public function testGetsCategoriesFromRss092_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Dc10() { $feed = Reader\Reader::importString( @@ -2333,7 +2334,7 @@ public function testGetsCategoriesFromRss093_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Dc10() { $feed = Reader\Reader::importString( @@ -2342,7 +2343,7 @@ public function testGetsCategoriesFromRss094_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Dc10() { $feed = Reader\Reader::importString( @@ -2351,9 +2352,9 @@ public function testGetsCategoriesFromRss10_Dc10() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + // DC 1.1 - + public function testGetsCategoriesFromRss090_Dc11() { $feed = Reader\Reader::importString( @@ -2362,7 +2363,7 @@ public function testGetsCategoriesFromRss090_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Dc11() { $feed = Reader\Reader::importString( @@ -2371,7 +2372,7 @@ public function testGetsCategoriesFromRss091_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Dc11() { $feed = Reader\Reader::importString( @@ -2380,7 +2381,7 @@ public function testGetsCategoriesFromRss092_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Dc11() { $feed = Reader\Reader::importString( @@ -2389,7 +2390,7 @@ public function testGetsCategoriesFromRss093_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Dc11() { $feed = Reader\Reader::importString( @@ -2398,7 +2399,7 @@ public function testGetsCategoriesFromRss094_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Dc11() { $feed = Reader\Reader::importString( @@ -2407,9 +2408,9 @@ public function testGetsCategoriesFromRss10_Dc11() $this->assertEquals($this->_expectedCatsRdf, (array) $feed->getCategories()); $this->assertEquals(array('topic1','topic2'), array_values($feed->getCategories()->getValues())); } - + // Atom 1.0 - + public function testGetsCategoriesFromRss090_Atom10() { $feed = Reader\Reader::importString( @@ -2418,7 +2419,7 @@ public function testGetsCategoriesFromRss090_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_Atom10() { $feed = Reader\Reader::importString( @@ -2427,7 +2428,7 @@ public function testGetsCategoriesFromRss091_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_Atom10() { $feed = Reader\Reader::importString( @@ -2436,7 +2437,7 @@ public function testGetsCategoriesFromRss092_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_Atom10() { $feed = Reader\Reader::importString( @@ -2445,7 +2446,7 @@ public function testGetsCategoriesFromRss093_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_Atom10() { $feed = Reader\Reader::importString( @@ -2454,7 +2455,7 @@ public function testGetsCategoriesFromRss094_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_Atom10() { $feed = Reader\Reader::importString( @@ -2463,9 +2464,9 @@ public function testGetsCategoriesFromRss10_Atom10() $this->assertEquals($this->_expectedCatsAtom, (array) $feed->getCategories()); $this->assertEquals(array('topic1','Cat & Dog'), array_values($feed->getCategories()->getValues())); } - + // No Categories In Entry - + public function testGetsCategoriesFromRss20_None() { $feed = Reader\Reader::importString( @@ -2474,7 +2475,7 @@ public function testGetsCategoriesFromRss20_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss090_None() { $feed = Reader\Reader::importString( @@ -2483,7 +2484,7 @@ public function testGetsCategoriesFromRss090_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss091_None() { $feed = Reader\Reader::importString( @@ -2492,7 +2493,7 @@ public function testGetsCategoriesFromRss091_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss092_None() { $feed = Reader\Reader::importString( @@ -2501,7 +2502,7 @@ public function testGetsCategoriesFromRss092_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss093_None() { $feed = Reader\Reader::importString( @@ -2510,7 +2511,7 @@ public function testGetsCategoriesFromRss093_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss094_None() { $feed = Reader\Reader::importString( @@ -2519,7 +2520,7 @@ public function testGetsCategoriesFromRss094_None() $this->assertEquals(array(), (array) $feed->getCategories()); $this->assertEquals(array(), array_values($feed->getCategories()->getValues())); } - + public function testGetsCategoriesFromRss10_None() { $feed = Reader\Reader::importString( diff --git a/test/Reader/Feed/_files/Atom/category/plain/atom03.xml b/test/Reader/Feed/_files/Atom/category/plain/atom03.xml index 510b42f8..cdac16c9 100644 --- a/test/Reader/Feed/_files/Atom/category/plain/atom03.xml +++ b/test/Reader/Feed/_files/Atom/category/plain/atom03.xml @@ -5,6 +5,6 @@ - + diff --git a/test/Reader/ReaderTest.php b/test/Reader/ReaderTest.php index b364e806..6f9f8664 100644 --- a/test/Reader/ReaderTest.php +++ b/test/Reader/ReaderTest.php @@ -145,7 +145,7 @@ public function testImportsUri() Reader\Reader::import('http://www.planet-php.net/rdf/'); } - + /** * @group ZF-8328 * @expectedException Zend\Feed\Reader\Exception\RuntimeException @@ -200,7 +200,7 @@ public function testZeroCountFeedSetReturnedFromEmptyList() $links = Reader\Reader::findFeedLinks('http://www.example.com'); $this->assertEquals(0, count($links)); } - + /** * @group ZF-8327 */ @@ -213,7 +213,7 @@ public function testGetsFeedLinksAndTrimsNewlines() $links = Reader\Reader::findFeedLinks('http://www.infopod.com.br'); $this->assertEquals('http://feeds.feedburner.com/jonnyken/infoblog', $links->rss); } - + /** * @group ZF-8330 */ @@ -226,7 +226,7 @@ public function testGetsFeedLinksAndNormalisesRelativeUrls() $links = Reader\Reader::findFeedLinks('http://meiobit.com'); $this->assertEquals('http://meiobit.com/rss.xml', $links->rss); } - + /** * @group ZF-8330 */ diff --git a/test/Writer/DeletedTest.php b/test/Writer/DeletedTest.php index e9f70062..5c4dc49b 100644 --- a/test/Writer/DeletedTest.php +++ b/test/Writer/DeletedTest.php @@ -45,7 +45,7 @@ public function testGetReferenceReturnsNullIfNotSet() $entry = new Writer\Deleted; $this->assertTrue(is_null($entry->getReference())); } - + public function testSetWhenDefaultsToCurrentTime() { $entry = new Writer\Deleted; @@ -61,7 +61,7 @@ public function testSetWhenUsesGivenUnixTimestamp() $myDate = new DateTime('@' . 1234567890); $this->assertEquals($myDate, $entry->getWhen()); } - + /** * @group ZF-12070 */ @@ -83,7 +83,7 @@ public function testSetWhenUsesGivenUnixTimestampWhenItIsAVerySmallInteger() $myDate = new DateTime('@' . 123); $this->assertEquals($myDate, $entry->getWhen()); } - + public function testSetWhenUsesDateTimeObject() { $myDate = new DateTime('@' . 1234567890); @@ -91,7 +91,7 @@ public function testSetWhenUsesDateTimeObject() $entry->setWhen($myDate); $this->assertEquals($myDate, $entry->getWhen()); } - + public function testSetWhenThrowsExceptionOnInvalidParameter() { $entry = new Writer\Deleted; @@ -101,13 +101,13 @@ public function testSetWhenThrowsExceptionOnInvalidParameter() } catch (Writer\Exception\ExceptionInterface $e) { } } - + public function testGetWhenReturnsNullIfDateNotSet() { $entry = new Writer\Deleted; $this->assertTrue(is_null($entry->getWhen())); } - + public function testAddsByNameFromArray() { $entry = new Writer\Deleted; diff --git a/test/Writer/Extension/ITunes/EntryTest.php b/test/Writer/Extension/ITunes/EntryTest.php index 5bcce521..9e8ebbc0 100644 --- a/test/Writer/Extension/ITunes/EntryTest.php +++ b/test/Writer/Extension/ITunes/EntryTest.php @@ -28,7 +28,7 @@ public function testSetBlock() $entry->setItunesBlock('yes'); $this->assertEquals('yes', $entry->getItunesBlock()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -37,7 +37,7 @@ public function testSetBlockThrowsExceptionOnNonAlphaValue() $entry = new Writer\Entry; $entry->setItunesBlock('123'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -46,21 +46,21 @@ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() $entry = new Writer\Entry; $entry->setItunesBlock(str_repeat('a', 256)); } - + public function testAddAuthors() { $entry = new Writer\Entry; $entry->addItunesAuthors(array('joe', 'jane')); $this->assertEquals(array('joe', 'jane'), $entry->getItunesAuthors()); } - + public function testAddAuthor() { $entry = new Writer\Entry; $entry->addItunesAuthor('joe'); $this->assertEquals(array('joe'), $entry->getItunesAuthors()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -69,28 +69,28 @@ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() $entry = new Writer\Entry; $entry->addItunesAuthor(str_repeat('a', 256)); } - + public function testSetDurationAsSeconds() { $entry = new Writer\Entry; $entry->setItunesDuration(23); $this->assertEquals(23, $entry->getItunesDuration()); } - + public function testSetDurationAsMinutesAndSeconds() { $entry = new Writer\Entry; $entry->setItunesDuration('23:23'); $this->assertEquals('23:23', $entry->getItunesDuration()); } - + public function testSetDurationAsHoursMinutesAndSeconds() { $entry = new Writer\Entry; $entry->setItunesDuration('23:23:23'); $this->assertEquals('23:23:23', $entry->getItunesDuration()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -99,7 +99,7 @@ public function testSetDurationThrowsExceptionOnUnknownFormat() $entry = new Writer\Entry; $entry->setItunesDuration('abc'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -108,7 +108,7 @@ public function testSetDurationThrowsExceptionOnInvalidSeconds() $entry = new Writer\Entry; $entry->setItunesDuration('23:456'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -117,28 +117,28 @@ public function testSetDurationThrowsExceptionOnInvalidMinutes() $entry = new Writer\Entry; $entry->setItunesDuration('23:234:45'); } - + public function testSetExplicitToYes() { $entry = new Writer\Entry; $entry->setItunesExplicit('yes'); $this->assertEquals('yes', $entry->getItunesExplicit()); } - + public function testSetExplicitToNo() { $entry = new Writer\Entry; $entry->setItunesExplicit('no'); $this->assertEquals('no', $entry->getItunesExplicit()); } - + public function testSetExplicitToClean() { $entry = new Writer\Entry; $entry->setItunesExplicit('clean'); $this->assertEquals('clean', $entry->getItunesExplicit()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -147,7 +147,7 @@ public function testSetExplicitThrowsExceptionOnUnknownTerm() $entry = new Writer\Entry; $entry->setItunesExplicit('abc'); } - + public function testSetKeywords() { $entry = new Writer\Entry; @@ -157,7 +157,7 @@ public function testSetKeywords() $entry->setItunesKeywords($words); $this->assertEquals($words, $entry->getItunesKeywords()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -169,7 +169,7 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() ); $entry->setItunesKeywords($words); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -181,14 +181,14 @@ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharL ); $entry->setItunesKeywords($words); } - + public function testSetSubtitle() { $entry = new Writer\Entry; $entry->setItunesSubtitle('abc'); $this->assertEquals('abc', $entry->getItunesSubtitle()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -197,14 +197,14 @@ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() $entry = new Writer\Entry; $entry->setItunesSubtitle(str_repeat('a', 256)); } - + public function testSetSummary() { $entry = new Writer\Entry; $entry->setItunesSummary('abc'); $this->assertEquals('abc', $entry->getItunesSummary()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ diff --git a/test/Writer/Extension/ITunes/FeedTest.php b/test/Writer/Extension/ITunes/FeedTest.php index 6e7ecf46..d9b5af0b 100644 --- a/test/Writer/Extension/ITunes/FeedTest.php +++ b/test/Writer/Extension/ITunes/FeedTest.php @@ -28,7 +28,7 @@ public function testSetBlock() $feed->setItunesBlock('yes'); $this->assertEquals('yes', $feed->getItunesBlock()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -37,7 +37,7 @@ public function testSetBlockThrowsExceptionOnNonAlphaValue() $feed = new Writer\Feed; $feed->setItunesBlock('123'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -46,21 +46,21 @@ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() $feed = new Writer\Feed; $feed->setItunesBlock(str_repeat('a', 256)); } - + public function testAddAuthors() { $feed = new Writer\Feed; $feed->addItunesAuthors(array('joe', 'jane')); $this->assertEquals(array('joe', 'jane'), $feed->getItunesAuthors()); } - + public function testAddAuthor() { $feed = new Writer\Feed; $feed->addItunesAuthor('joe'); $this->assertEquals(array('joe'), $feed->getItunesAuthors()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -69,7 +69,7 @@ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() $feed = new Writer\Feed; $feed->addItunesAuthor(str_repeat('a', 256)); } - + public function testSetCategories() { $feed = new Writer\Feed; @@ -80,7 +80,7 @@ public function testSetCategories() $feed->setItunesCategories($cats); $this->assertEquals($cats, $feed->getItunesCategories()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -94,21 +94,21 @@ public function testSetCategoriesThrowsExceptionIfAnyCatNameGreaterThan255CharsL $feed->setItunesCategories($cats); $this->assertEquals($cats, $feed->getItunesAuthors()); } - + public function testSetImageAsPngFile() { $feed = new Writer\Feed; $feed->setItunesImage('http://www.example.com/image.png'); $this->assertEquals('http://www.example.com/image.png', $feed->getItunesImage()); } - + public function testSetImageAsJpgFile() { $feed = new Writer\Feed; $feed->setItunesImage('http://www.example.com/image.jpg'); $this->assertEquals('http://www.example.com/image.jpg', $feed->getItunesImage()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -117,7 +117,7 @@ public function testSetImageThrowsExceptionOnInvalidUri() $feed = new Writer\Feed; $feed->setItunesImage('http://'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -126,28 +126,28 @@ public function testSetImageThrowsExceptionOnInvalidImageExtension() $feed = new Writer\Feed; $feed->setItunesImage('http://www.example.com/image.gif'); } - + public function testSetDurationAsSeconds() { $feed = new Writer\Feed; $feed->setItunesDuration(23); $this->assertEquals(23, $feed->getItunesDuration()); } - + public function testSetDurationAsMinutesAndSeconds() { $feed = new Writer\Feed; $feed->setItunesDuration('23:23'); $this->assertEquals('23:23', $feed->getItunesDuration()); } - + public function testSetDurationAsHoursMinutesAndSeconds() { $feed = new Writer\Feed; $feed->setItunesDuration('23:23:23'); $this->assertEquals('23:23:23', $feed->getItunesDuration()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -156,7 +156,7 @@ public function testSetDurationThrowsExceptionOnUnknownFormat() $feed = new Writer\Feed; $feed->setItunesDuration('abc'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -165,7 +165,7 @@ public function testSetDurationThrowsExceptionOnInvalidSeconds() $feed = new Writer\Feed; $feed->setItunesDuration('23:456'); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -174,28 +174,28 @@ public function testSetDurationThrowsExceptionOnInvalidMinutes() $feed = new Writer\Feed; $feed->setItunesDuration('23:234:45'); } - + public function testSetExplicitToYes() { $feed = new Writer\Feed; $feed->setItunesExplicit('yes'); $this->assertEquals('yes', $feed->getItunesExplicit()); } - + public function testSetExplicitToNo() { $feed = new Writer\Feed; $feed->setItunesExplicit('no'); $this->assertEquals('no', $feed->getItunesExplicit()); } - + public function testSetExplicitToClean() { $feed = new Writer\Feed; $feed->setItunesExplicit('clean'); $this->assertEquals('clean', $feed->getItunesExplicit()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -204,7 +204,7 @@ public function testSetExplicitThrowsExceptionOnUnknownTerm() $feed = new Writer\Feed; $feed->setItunesExplicit('abc'); } - + public function testSetKeywords() { $feed = new Writer\Feed; @@ -214,7 +214,7 @@ public function testSetKeywords() $feed->setItunesKeywords($words); $this->assertEquals($words, $feed->getItunesKeywords()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -226,7 +226,7 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() ); $feed->setItunesKeywords($words); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -238,14 +238,14 @@ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharL ); $feed->setItunesKeywords($words); } - + public function testSetNewFeedUrl() { $feed = new Writer\Feed; $feed->setItunesNewFeedUrl('http://example.com/feed'); $this->assertEquals('http://example.com/feed', $feed->getItunesNewFeedUrl()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -254,28 +254,28 @@ public function testSetNewFeedUrlThrowsExceptionOnInvalidUri() $feed = new Writer\Feed; $feed->setItunesNewFeedUrl('http://'); } - + public function testAddOwner() { $feed = new Writer\Feed; $feed->addItunesOwner(array('name'=>'joe','email'=>'joe@example.com')); $this->assertEquals(array(array('name'=>'joe','email'=>'joe@example.com')), $feed->getItunesOwners()); } - + public function testAddOwners() { $feed = new Writer\Feed; $feed->addItunesOwners(array(array('name'=>'joe','email'=>'joe@example.com'))); $this->assertEquals(array(array('name'=>'joe','email'=>'joe@example.com')), $feed->getItunesOwners()); } - + public function testSetSubtitle() { $feed = new Writer\Feed; $feed->setItunesSubtitle('abc'); $this->assertEquals('abc', $feed->getItunesSubtitle()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */ @@ -284,14 +284,14 @@ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() $feed = new Writer\Feed; $feed->setItunesSubtitle(str_repeat('a', 256)); } - + public function testSetSummary() { $feed = new Writer\Feed; $feed->setItunesSummary('abc'); $this->assertEquals('abc', $feed->getItunesSummary()); } - + /** * @expectedException Zend\Feed\Writer\Exception\ExceptionInterface */