Qual: Fix PhanPluginDuplicateIfStatements & remove exceptions (#28749)

# Qual: Fix PhanPluginDuplicateIfStatements & remove exceptions

Fix occurences of PhanPluginDuplicateIfStatements which are if statements where the
consecutive branches execute the same code, making it useles to test the condition
This commit is contained in:
MDW
2024-03-11 12:58:51 +01:00
committed by GitHub
parent aee0509473
commit dbfb1180ee
23 changed files with 1535 additions and 1683 deletions

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -475,30 +476,21 @@ class RssParser
}
}
} elseif ($rss->_format == 'atom') {
if (getDolGlobalString('EXTERNALRSS_USE_SIMPLEXML')) {
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
$itemTitle = sanitizeVal((string) $item['title']);
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
$itemPubDate = sanitizeVal((string) $item['created']);
$itemId = sanitizeVal((string) $item['id']);
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
} else {
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
$itemTitle = sanitizeVal((string) $item['title']);
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
$itemPubDate = sanitizeVal((string) $item['created']);
$itemId = sanitizeVal((string) $item['id']);
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
}
$itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
$itemTitle = sanitizeVal((string) $item['title']);
$itemDescription = sanitizeVal($this->getAtomItemDescription($item));
$itemPubDate = sanitizeVal((string) $item['created']);
$itemId = sanitizeVal((string) $item['id']);
$itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
$itemCategory = array();
} else {
$itemCategory = array();
$itemLink = '';
$itemTitle = '';
$itemDescription = '';
$itemPubDate = '';
$itemId = '';
$itemAuthor = '';
$itemCategory = array();
print 'ErrorBadFeedFormat';
}