Address PHPStan 'right side always true' in FeedItem_RSS.

This commit is contained in:
wn_ 2023-03-05 14:02:26 +00:00
parent d34d01fd72
commit c48dd6a3c4
1 changed files with 8 additions and 9 deletions

View File

@ -84,15 +84,6 @@ class FeedItem_RSS extends FeedItem_Common {
/** @var DOMElement|null */
$contentB = $this->elem->getElementsByTagName("description")->item(0);
if ($contentA && !$contentB) {
return $this->subtree_or_text($contentA);
}
if ($contentB && !$contentA) {
return $this->subtree_or_text($contentB);
}
if ($contentA && $contentB) {
$resultA = $this->subtree_or_text($contentA);
$resultB = $this->subtree_or_text($contentB);
@ -100,6 +91,14 @@ class FeedItem_RSS extends FeedItem_Common {
return mb_strlen($resultA) > mb_strlen($resultB) ? $resultA : $resultB;
}
if ($contentA) {
return $this->subtree_or_text($contentA);
}
if ($contentB) {
return $this->subtree_or_text($contentB);
}
return '';
}