Merge pull request #10422 from frederic34/elseif

PSR2 usage of else if is discouraged
This commit is contained in:
Laurent Destailleur 2019-01-27 17:54:21 +01:00 committed by GitHub
commit da1b12a0d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
335 changed files with 1522 additions and 1524 deletions

View File

@ -401,6 +401,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);