mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Qual: Phan fixes (mainly Initial type cannot be inferred) in popular changed classes (#30604)
* Update setValueFrom $id type to include null * Only 2 arguments for ModeleNumRefMembers::getToolTip * Fix PhanTypeConversionFromArray * Only 6 args for PaymentSalary::addPaymentToBank * Fix typing hints (array -> string) * Fix uninitialized variables * Add cssview to attributes phpdoc * Avoid double typing specification (Phan notice) * Qual: Ensure variable is defined (phan) * Ensure phpdoc typing for verif method * Ensure phpdoc typing for getNextValue method * Add status as data key in cols array * Ensure preg_replace operates on string (phan) * Correct type for desiredstock * Fix typing with casts (phan) * Fix check that notification already exists * Initialise fk_parent_id to fix typing issue * Qual: Fix phan notices for Societe & related * Qual: Fix typing for Facture and related * Qual: Fix typing for Product & related * Update baseline * Fix new phpstan notices
This commit is contained in:
@@ -156,4 +156,22 @@ abstract class ModeleNumRefBarCode extends CommonNumRefGenerator
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check validity of code according to its rules
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $code Code to check/correct
|
||||
* @param Product|Societe $object Object product or ThirdParty
|
||||
* @param int<0,1> $thirdparty_type 0 = customer/prospect , 1 = supplier
|
||||
* @param string $type type of barcode (EAN, ISBN, ...)
|
||||
* @return int<-7,0> 0 if OK
|
||||
* -1 ErrorBadCustomerCodeSyntax
|
||||
* -2 ErrorCustomerCodeRequired
|
||||
* -3 ErrorCustomerCodeAlreadyUsed
|
||||
* -4 ErrorPrefixRequired
|
||||
* -7 ErrorBadClass
|
||||
*/
|
||||
abstract public function verif($db, &$code, $object, $thirdparty_type, $type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user