summaryrefslogtreecommitdiff
path: root/classes/feedparser.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2022-08-12 18:21:38 +0000
committerwn_ <[email protected]>2022-08-12 18:21:38 +0000
commitc301053965004f43408545f4b80cf444ce6a9587 (patch)
tree8a7ea219a065bceee9924553d4003806d0f5c1fd /classes/feedparser.php
parent3487c922b3f34449fecdddebe1fd2ee3b8c42e65 (diff)
Use the null coalescing assignment operator in various places.
Diffstat (limited to 'classes/feedparser.php')
-rw-r--r--classes/feedparser.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/classes/feedparser.php b/classes/feedparser.php
index fc2489e2d..4b9c63f56 100644
--- a/classes/feedparser.php
+++ b/classes/feedparser.php
@@ -43,10 +43,8 @@ class FeedParser {
foreach (libxml_get_errors() as $error) {
if ($error->level == LIBXML_ERR_FATAL) {
// currently only the first error is reported
- if (!isset($this->error)) {
- $this->error = $this->format_error($error);
- }
- $this->libxml_errors[] = $this->format_error($error);
+ $this->error ??= Errors::format_libxml_error($error);
+ $this->libxml_errors[] = Errors::format_libxml_error($error);
}
}
}
@@ -87,9 +85,7 @@ class FeedParser {
$this->type = $this::FEED_ATOM;
break;
default:
- if (!isset($this->error)) {
- $this->error = "Unknown/unsupported feed type";
- }
+ $this->error ??= "Unknown/unsupported feed type";
return;
}
}
@@ -186,9 +182,7 @@ class FeedParser {
if ($this->link) $this->link = trim($this->link);
} else {
- if (!isset($this->error)) {
- $this->error = "Unknown/unsupported feed type";
- }
+ $this->error ??= "Unknown/unsupported feed type";
return;
}
}