Mercurial > hg > cmmr2012-drupal-site
diff vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php Thu Jul 05 15:32:06 2018 +0100 +++ b/vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/AbstractAtom.php Tue Jul 10 13:19:18 2018 +0000 @@ -37,8 +37,10 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLanguage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd if ($this->getDataContainer()->getLanguage()) { $root->setAttribute('xml:lang', $this->getDataContainer() ->getLanguage()); @@ -53,13 +55,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setTitle(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getTitle()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getTitle()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:title element but a title has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -81,9 +85,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDescription(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDescription()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDescription()) { return; } $subtitle = $dom->createElement('subtitle'); @@ -101,13 +107,15 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setDateModified(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateModified()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateModified()) { $message = 'Atom 1.0 feed elements MUST contain exactly one' . ' atom:updated element but a modification date has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -130,11 +138,16 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setGenerator(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getGenerator()) { - $this->getDataContainer()->setGenerator('Zend_Feed_Writer', - Version::VERSION, 'http://framework.zend.com'); + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getGenerator()) { + $this->getDataContainer()->setGenerator( + 'Zend_Feed_Writer', + Version::VERSION, + 'http://framework.zend.com' + ); } $gdata = $this->getDataContainer()->getGenerator(); @@ -157,9 +170,11 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setLink(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getLink()) { return; } $link = $dom->createElement('link'); @@ -177,16 +192,18 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $flinks = $this->getDataContainer()->getFeedLinks(); - if (!$flinks || !array_key_exists('atom', $flinks)) { + if (! $flinks || ! array_key_exists('atom', $flinks)) { $message = 'Atom 1.0 feed elements SHOULD contain one atom:link ' . 'element with a rel attribute value of "self". This is the ' . 'preferred URI for retrieving Atom Feed Documents representing ' . 'this Atom feed but a feed link has not been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -211,10 +228,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setAuthors(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $authors = $this->container->getAuthors(); - if (!$authors || empty($authors)) { + if (! $authors || empty($authors)) { /** * Technically we should defer an exception until we can check * that all entries contain an author. If any entry is missing @@ -252,16 +271,18 @@ * @return void * @throws Writer\Exception\InvalidArgumentException */ + // @codingStandardsIgnoreStart protected function _setId(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getId() - && !$this->getDataContainer()->getLink()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getId() + && ! $this->getDataContainer()->getLink()) { $message = 'Atom 1.0 feed elements MUST contain exactly one ' . 'atom:id element, or as an alternative, we can use the same ' . 'value as atom:link however neither a suitable link nor an ' . 'id have been set'; $exception = new Writer\Exception\InvalidArgumentException($message); - if (!$this->ignoreExceptions) { + if (! $this->ignoreExceptions) { throw $exception; } else { $this->exceptions[] = $exception; @@ -269,9 +290,10 @@ } } - if (!$this->getDataContainer()->getId()) { + if (! $this->getDataContainer()->getId()) { $this->getDataContainer()->setId( - $this->getDataContainer()->getLink()); + $this->getDataContainer()->getLink() + ); } $id = $dom->createElement('id'); $root->appendChild($id); @@ -286,10 +308,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCopyright(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $copyright = $this->getDataContainer()->getCopyright(); - if (!$copyright) { + if (! $copyright) { return; } $copy = $dom->createElement('rights'); @@ -305,10 +329,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setImage(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $image = $this->getDataContainer()->getImage(); - if (!$image) { + if (! $image) { return; } $img = $dom->createElement('logo'); @@ -324,12 +350,14 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setDateCreated(DOMDocument $dom, DOMElement $root) { - if (!$this->getDataContainer()->getDateCreated()) { + // @codingStandardsIgnoreEnd + if (! $this->getDataContainer()->getDateCreated()) { return; } - if (!$this->getDataContainer()->getDateModified()) { + if (! $this->getDataContainer()->getDateModified()) { $this->getDataContainer()->setDateModified( $this->getDataContainer()->getDateCreated() ); @@ -343,10 +371,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $baseUrl = $this->getDataContainer()->getBaseUrl(); - if (!$baseUrl) { + if (! $baseUrl) { return; } $root->setAttribute('xml:base', $baseUrl); @@ -359,10 +389,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setHubs(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $hubs = $this->getDataContainer()->getHubs(); - if (!$hubs) { + if (! $hubs) { return; } foreach ($hubs as $hubUrl) { @@ -380,10 +412,12 @@ * @param DOMElement $root * @return void */ + // @codingStandardsIgnoreStart protected function _setCategories(DOMDocument $dom, DOMElement $root) { + // @codingStandardsIgnoreEnd $categories = $this->getDataContainer()->getCategories(); - if (!$categories) { + if (! $categories) { return; } foreach ($categories as $cat) {