diff options
author | wn_ <[email protected]> | 2022-08-12 18:21:38 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2022-08-12 18:21:38 +0000 |
commit | c301053965004f43408545f4b80cf444ce6a9587 (patch) | |
tree | 8a7ea219a065bceee9924553d4003806d0f5c1fd /classes/feedparser.php | |
parent | 3487c922b3f34449fecdddebe1fd2ee3b8c42e65 (diff) |
Use the null coalescing assignment operator in various places.
Diffstat (limited to 'classes/feedparser.php')
-rw-r--r-- | classes/feedparser.php | 14 |
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; } } |