Skip to content

Commit

Permalink
Try fix phan phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 27, 2024
1 parent 6eb8870 commit 13ad68d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ class Adherent extends CommonObject
*/
public $invoice;

/**
* @var Adherent To store a copy before update or delete
*/
public $oldcopy;


/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,comment?:string,validate?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
Expand Down Expand Up @@ -829,9 +834,8 @@ public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass =
$sql .= ", fk_user_mod = ".($user->id > 0 ? $user->id : 'null'); // Can be null because member can be create by a guest
$sql .= " WHERE rowid = ".((int) $this->id);

// If we change the type of membership, we set also label of new type.
'@phan-var-force Adherent $this->oldcopy';
/** @var Adherent $this->oldcopy */
// If we change the type of membership, we set also label of new type..
'@phan-var-force Adherent $oldcopy';
if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) {
$sql2 = "SELECT libelle as label";
$sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type";
Expand Down

0 comments on commit 13ad68d

Please sign in to comment.