PSR2 usage of else if is discouraged

This commit is contained in:
Frédéric FRANCE 2019-01-27 10:49:34 +01:00
parent a9da6a2d51
commit 6e91b3cefc
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
335 changed files with 1524 additions and 1526 deletions

View File

@ -392,6 +392,7 @@
<rule ref="PSR2.Classes.ClassDeclaration" /> <rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" /> <rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
<!-- This is not in PSR2 --> <!-- This is not in PSR2 -->
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore"> <rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">

View File

@ -96,9 +96,7 @@ if ($action == "set")
{ {
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;
} else } elseif (! $error)
if (! $error)
{ {
$db->commit(); $db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

View File

@ -125,8 +125,7 @@ if ($action == "deleteline") {
$invoice->deleteline($idline); $invoice->deleteline($idline);
$invoice->fetch($placeid); $invoice->fetch($placeid);
} }
else elseif ($placeid > 0) { //If exist invoice, but no line selected, proced to delete last line
if ($placeid > 0) { //If exist invoice, but no line selected, proced to delete last line
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='$placeid' order by rowid DESC"; $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='$placeid' order by rowid DESC";
$resql = $db->query($sql); $resql = $db->query($sql);
$row = $db->fetch_array($resql); $row = $db->fetch_array($resql);