Clean code

This commit is contained in:
Laurent Destailleur 2023-01-01 23:55:59 +01:00
parent 5c8dc4ed58
commit ac75406e35
3 changed files with 8 additions and 8 deletions

View File

@ -234,7 +234,7 @@ if ($action == 'add') {
} elseif ($action == 'delete' && $user->rights->ficheinter->supprimer) {
// delete modele
$object->fetch($id);
$object->delete();
$object->delete($user);
$id = 0;
header('Location: '.$_SERVER["PHP_SELF"]);
exit;

View File

@ -411,16 +411,13 @@ class FichinterRec extends Fichinter
/**
* Delete template fichinter rec
*
* @param int $rowid Id of fichinter rec to delete. If empty, we delete current instance of fichinter rec
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param int $idwarehouse Id warehouse to use for stock change.
* @param User $user Object user who delete
* @param int $notrigger Disable trigger
* @return int <0 if KO, >0 if OK
*/
public function delete($rowid = 0, $notrigger = 0, $idwarehouse = -1)
public function delete(User $user, $notrigger = 0)
{
if (empty($rowid)) {
$rowid = $this->id;
}
$rowid = $this->id;
dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG);

View File

@ -76,4 +76,7 @@ exclude:
- name: PhpMissingParentConstructorInspection
- name: PhpWriteAccessToReferencedArrayValueWithoutUnsetInspection
- name: PhpArrayUsedOnlyForWriteInspection
- name: PhpArrayIndexImmediatelyRewrittenInspection
- name: PhpParameterNameChangedDuringInheritanceInspection
- name: PhpDuplicateSwitchCaseBodyInspection