diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2022-08-06 14:07:36 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-08-19 09:14:27 +0200 |
commit | c09cca75b50d94b2d0d14f43b1136527364573d0 (patch) | |
tree | 0a237e312da1fd4342ad8f2a10a2f5ed37c8e64b /lib/Utility | |
parent | df04eb2723ea630c612d680d8e356e5d979f55e2 (diff) |
Fix deprecations
add phpstan deprecation rules
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'lib/Utility')
-rw-r--r-- | lib/Utility/OPMLExporter.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/Utility/OPMLExporter.php b/lib/Utility/OPMLExporter.php index aa06f5dbf..bb813daf8 100644 --- a/lib/Utility/OPMLExporter.php +++ b/lib/Utility/OPMLExporter.php @@ -90,11 +90,21 @@ class OPMLExporter protected function createFeedOutline(Feed $feed, DOMDocument $document) { $feedOutline = $document->createElement('outline'); - $feedOutline->setAttribute('title', $feed->getTitle()); - $feedOutline->setAttribute('text', $feed->getTitle()); - $feedOutline->setAttribute('type', 'rss'); - $feedOutline->setAttribute('xmlUrl', $feed->getUrl()); - $feedOutline->setAttribute('htmlUrl', $feed->getLink()); + $attributes = [ + ['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]); + } + } return $feedOutline; } |