diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-08-29 23:39:35 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-27 15:35:31 +0200 |
commit | d00d1ab2a28f428223e52b17052c072c64784016 (patch) | |
tree | c019f85fb7ac67147dd43ca64b4ac3cda99832f7 /lib/Utility/OPMLExporter.php | |
parent | 5687baca75d47dbdffd3de74e865ad2f71ef0cb7 (diff) |
Create V2 mapper, Service and management commands
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Utility/OPMLExporter.php')
-rw-r--r-- | lib/Utility/OPMLExporter.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Utility/OPMLExporter.php b/lib/Utility/OPMLExporter.php index 189cf8d1e..8c21fa204 100644 --- a/lib/Utility/OPMLExporter.php +++ b/lib/Utility/OPMLExporter.php @@ -13,6 +13,8 @@ namespace OCA\News\Utility; +use \DOMDocument; +use \DOMElement; use OCA\News\Db\Feed; /** @@ -26,11 +28,11 @@ class OPMLExporter * * @param \OCA\News\Db\Folder[] $folders * @param \OCA\News\Db\Feed[] $feeds - * @return \DomDocument the document + * @return DOMDocument the document */ - public function build($folders, $feeds) + public function build(array $folders, array $feeds) { - $document = new \DomDocument('1.0', 'UTF-8'); + $document = new DOMDocument('1.0', 'UTF-8'); $document->formatOutput = true; $root = $document->createElement('opml'); @@ -81,10 +83,10 @@ class OPMLExporter /** * @param Feed $feed - * @param \DOMDocument $document - * @return \DOMElement + * @param DOMDocument $document + * @return DOMElement */ - protected function createFeedOutline($feed, $document) + protected function createFeedOutline(Feed $feed, DOMDocument $document) { $feedOutline = $document->createElement('outline'); $feedOutline->setAttribute('title', $feed->getTitle()); @@ -92,6 +94,7 @@ class OPMLExporter $feedOutline->setAttribute('type', 'rss'); $feedOutline->setAttribute('xmlUrl', $feed->getUrl()); $feedOutline->setAttribute('htmlUrl', $feed->getLink()); + return $feedOutline; } } |