Fix warnings

This commit is contained in:
Laurent Destailleur 2023-05-02 04:11:05 +02:00
parent 10a58e5513
commit 98067fbfb4
13 changed files with 62 additions and 65 deletions

View File

@ -932,8 +932,8 @@ class Account extends CommonObject
/**
* Update BBAN (RIB) account fields
*
* @param User $user Object user making update
* @return int <0 if KO, >0 if OK
* @param User|null $user Object user making update
* @return int <0 if KO, >0 if OK
*/
public function update_bban(User $user = null)
{
@ -1110,8 +1110,8 @@ class Account extends CommonObject
/**
* Delete bank account from database
*
* @param User $user User deleting
* @return int <0 if KO, >0 if OK
* @param User|null $user User deleting
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user = null)
{
@ -2158,8 +2158,8 @@ class AccountLine extends CommonObjectLine
/**
* Delete bank transaction record
*
* @param User $user User object that delete
* @return int <0 if KO, >0 if OK
* @param User|null $user User object that delete
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user = null)
{
@ -2231,10 +2231,10 @@ class AccountLine extends CommonObjectLine
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Delete bank line records
* Delete bank line records
*
* @param User $user User object that delete
* @return int <0 if KO, >0 if OK
* @param User|null $user User object that delete
* @return int <0 if KO, >0 if OK
*/
public function delete_urls(User $user = null)
{

View File

@ -170,9 +170,9 @@ class BankCateg // extends CommonObject
/**
* Update database
*
* @param User $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
* @param User|null $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
public function update(User $user = null, $notrigger = 0)
{

View File

@ -931,11 +931,11 @@ class Paiement extends CommonObject
}
/**
* Validate payment
* Validate payment
*
* @param User $user User making validation
* @return int <0 if KO, >0 if OK
* @deprecated
* @param User|null $user User making validation
* @return int <0 if KO, >0 if OK
* @deprecated
*/
public function valide(User $user = null)
{
@ -943,10 +943,10 @@ class Paiement extends CommonObject
}
/**
* Validate payment
* Validate payment
*
* @param User $user User making validation
* @return int <0 if KO, >0 if OK
* @param User|null $user User making validation
* @return int <0 if KO, >0 if OK
*/
public function validate(User $user = null)
{
@ -964,10 +964,10 @@ class Paiement extends CommonObject
}
/**
* Reject payment
* Reject payment
*
* @param User $user User making reject
* @return int <0 if KO, >0 if OK
* @param User|null $user User making reject
* @return int <0 if KO, >0 if OK
*/
public function reject(User $user = null)
{
@ -985,10 +985,10 @@ class Paiement extends CommonObject
}
/**
* Information sur l'objet
* Information sur l'objet
*
* @param int $id id du paiement dont il faut afficher les infos
* @return void
* @param int $id id du paiement dont il faut afficher les infos
* @return void
*/
public function info($id)
{

View File

@ -25,9 +25,9 @@
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param string $type Type of category
* @return array Array of tabs to show
* @param Categorie $object Object related to tabs
* @param string $type Type of category
* @return array Array of tabs to show
*/
function categories_prepare_head(Categorie $object, $type)
{

View File

@ -92,12 +92,11 @@ function expensereport_prepare_head($object)
* Returns an array with the tabs for the "Expense report payment" section
* It loads tabs from modules looking for the entity payment
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
* @param PaymentExpenseReport $object Current payment object
* @return array Tabs for the payment section
*/
function payment_expensereport_prepare_head(PaymentExpenseReport $object)
{
global $langs, $conf;
$h = 0;

View File

@ -113,8 +113,8 @@ function dolGetModulesDirs($subdir = '')
/**
* Try to guess default paper format according to language into $langs
*
* @param Translate $outputlangs Output lang to use to autodetect output format if setup not done
* @return string Default paper format code
* @param Translate|null $outputlangs Output lang to use to autodetect output format if setup not done
* @return string Default paper format code
*/
function dol_getDefaultFormat(Translate $outputlangs = null)
{

View File

@ -78,9 +78,9 @@ function pdf_admin_prepare_head()
/**
* Return array with format properties of default PDF format
*
* @param Translate $outputlangs Output lang to use to autodetect output format if we need 'auto' detection
* @param string $mode 'setup' = Use setup, 'auto' = Force autodetection whatever is setup
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
* @param Translate|null $outputlangs Output lang to use to autodetect output format if we need 'auto' detection
* @param string $mode 'setup' = Use setup, 'auto' = Force autodetection whatever is setup
* @return array Array('width'=>w,'height'=>h,'unit'=>u);
*/
function pdf_getFormat(Translate $outputlangs = null, $mode = 'setup')
{

View File

@ -184,15 +184,13 @@ class doc_generic_project_odt extends ModelePDFProjects
/**
* Define array with couple substitution key => substitution value
*
* @param array $task Task Object
* @param Task $task Task Object
* @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array
*/
public function get_substitutionarray_tasks(Task $task, $outputlangs)
{
// phpcs:enable
global $conf;
$resarray = array(
'task_ref'=>$task->ref,
'task_fk_project'=>$task->fk_project,

View File

@ -1138,9 +1138,9 @@ class ExpenseReport extends CommonObject
/**
* Delete object in database
*
* @param User $user User that delete
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, >0 if OK
* @param User|null $user User that delete
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user = null, $notrigger = false)
{

View File

@ -102,9 +102,9 @@ class CompanyBankAccount extends Account
/**
* Create bank information record.
*
* @param User $user User
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, > 0 if OK (ID of newly created company bank account information)
* @param User|null $user User
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, > 0 if OK (ID of newly created company bank account information)
*/
public function create(User $user = null, $notrigger = 0)
{
@ -170,13 +170,13 @@ class CompanyBankAccount extends Account
/**
* Update bank account
*
* @param User $user Object user
* @param int $notrigger 1=Disable triggers
* @return int <=0 if KO, >0 if OK
* @param User|null $user Object user
* @param int $notrigger 1=Disable triggers
* @return int <=0 if KO, >0 if OK
*/
public function update(User $user = null, $notrigger = 0)
{
global $conf, $langs;
global $langs;
$error = 0;
@ -321,9 +321,9 @@ class CompanyBankAccount extends Account
/**
* Delete a rib from database
*
* @param User $user User deleting
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, >0 if OK
* @param User|null $user User deleting
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user = null, $notrigger = 0)
{

View File

@ -2040,10 +2040,10 @@ class Societe extends CommonObject
/**
* Delete a third party from database and all its dependencies (contacts, rib...)
*
* @param int $id Id of third party to delete
* @param User $fuser User who ask to delete thirdparty
* @param int $call_trigger 0=No, 1=yes
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @param int $id Id of third party to delete
* @param User|null $fuser User who ask to delete thirdparty
* @param int $call_trigger 0=No, 1=yes
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/
public function delete($id, User $fuser = null, $call_trigger = 1)
{

View File

@ -85,9 +85,9 @@ class UserBankAccount extends Account
/**
* Create bank information record
*
* @param User $user User
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, >= 0 if OK
* @param User|null $user User
* @param int $notrigger 1=Disable triggers
* @return int <0 if KO, >= 0 if OK
*/
public function create(User $user = null, $notrigger = 0)
{
@ -111,9 +111,9 @@ class UserBankAccount extends Account
/**
* Update bank account
*
* @param User $user Object user
* @param int $notrigger 1=Disable triggers
* @return int <=0 if KO, >0 if OK
* @param User|null $user Object user
* @param int $notrigger 1=Disable triggers
* @return int <=0 if KO, >0 if OK
*/
public function update(User $user = null, $notrigger = 0)
{
@ -227,8 +227,8 @@ class UserBankAccount extends Account
/**
* Delete user bank account from database
*
* @param User $user User deleting
* @return int <0 if KO, >0 if OK
* @param User|null $user User deleting
* @return int <0 if KO, >0 if OK
*/
public function delete(User $user = null)
{

View File

@ -114,5 +114,5 @@ exclude:
- name: PhpDocMissingThrowsInspection
- name: UnnecessaryLabelJS
- name: JSCheckFunctionSignatures
- name: PhpReturnDocTypeMismatchInspection