diff options
author | fox <[email protected]> | 2022-08-17 19:38:15 +0300 |
---|---|---|
committer | fox <[email protected]> | 2022-08-17 19:38:15 +0300 |
commit | 60658be5bc35192f9b2d9aaf413454f29fe51316 (patch) | |
tree | d7f6aa1b6bf3eaa4d7a9601e46e15441bc737d9e /classes/feedparser.php | |
parent | ec764f97e7e3e0fac20f93364c84dfa01651bf95 (diff) | |
parent | 0dbed700efa77355839a4d2cddf02f93203dc96f (diff) |
Merge pull request 'Use PHP 7.4 features' (#77) from wn/tt-rss:feature/php-7.4-stuff into master
Reviewed-on: https://dev.tt-rss.org/fox/tt-rss/pulls/77
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; } } |