Skip to content

Commit

Permalink
improve implementation
Browse files Browse the repository at this point in the history
Co-authored-by: anoy. <anoymouserver@users.noreply.github.com>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
  • Loading branch information
Grotax and anoymouserver authored Aug 18, 2022
1 parent f380f3c commit 753ae93
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/Utility/OPMLExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,15 @@ protected function createFeedOutline(Feed $feed, DOMDocument $document)
{
$feedOutline = $document->createElement('outline');
$attributes = [
['title', $feed->getTitle()],
['text', $feed->getTitle()],
['type', 'rss'],
['xmlUrl', $feed->getUrl()],
['htmlUrl', $feed->getLink()],
'title' => $feed->getTitle(),
'text' => $feed->getTitle(),
'type' => 'rss',
'xmlUrl' => $feed->getUrl(),
'htmlUrl' => $feed->getLink(),
];

foreach ($attributes as $attribute) {
if (is_null($attribute[1])) {
$feedOutline->setAttribute($attribute[0], "");
} else {
$feedOutline->setAttribute($attribute[0], $attribute[1]);
}
foreach ($attributes as $name => $value) {
$feedOutline->setAttribute($name, $value ?? '');
}

return $feedOutline;
Expand Down

0 comments on commit 753ae93

Please sign in to comment.