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:
MDW
2024-08-14 01:24:55 +02:00
committed by GitHub
parent 8810753422
commit e570f59e2d
43 changed files with 873 additions and 451 deletions

View File

@@ -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);
}