Merge pull request #10422 from frederic34/elseif
PSR2 usage of else if is discouraged
This commit is contained in:
commit
da1b12a0d0
@ -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">
|
||||||
|
|||||||
@ -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');
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user