Fix warnings

This commit is contained in:
Laurent Destailleur 2023-08-06 13:02:33 +02:00
parent 8b1ed46df6
commit c1b0f187bc
7 changed files with 17 additions and 11 deletions

View File

@ -350,18 +350,18 @@ class Thirdparties extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->companytoremove = new Societe($this->db);
$companytoremove = new Societe($this->db);
$result = $this->companytoremove->fetch($idtodelete); // include the fetch of extra fields
$result = $companytoremove->fetch($idtodelete); // include the fetch of extra fields
if (!$result) {
throw new RestException(404, 'Thirdparty not found');
}
if (!DolibarrApi::_checkAccessToResource('societe', $this->companytoremove->id)) {
if (!DolibarrApi::_checkAccessToResource('societe', $companytoremove->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$soc_origin = $this->companytoremove;
$soc_origin = $companytoremove;
$object = $this->company;
$user = DolibarrApiAccess::$user;
@ -476,7 +476,8 @@ class Thirdparties extends DolibarrApi
// External modules should update their ones too
if (!$error) {
$parameters = array('soc_origin' => $soc_origin->id, 'soc_dest' => $object->id);
$reshook = $hookmanager->executeHooks('replaceThirdparty', $parameters, $soc_dest, $action);
$action = '';
$reshook = $hookmanager->executeHooks('replaceThirdparty', $parameters, $object, $action);
if ($reshook < 0) {
//setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -509,7 +510,7 @@ class Thirdparties extends DolibarrApi
if ($error) {
$this->db->rollback();
throw new RestException(500, 'Error failed to merged thirdparty '.$this->companytoremove->id.' into '.$id.'. Enable and read log file for more information.');
throw new RestException(500, 'Error failed to merged thirdparty '.$companytoremove->id.' into '.$id.'. Enable and read log file for more information.');
} else {
$this->db->commit();
}

View File

@ -51,6 +51,11 @@ parameters:
- '#Result of function fieldList#'
- '#Caught class Stripe#'
- '#Function llxHeaderVierge invoked with#'
- '#If condition is always true#'
- '#always exists and is not falsy#'
- '#has no return type specified#'
- '#expression is always#'
- '#always exists and is not nullable#'
internalErrorsCountLimit: 50
cache:
nodesByFileCountMax: 512

View File

@ -237,7 +237,7 @@ if ($resql) {
* @param string $userlang Code lang to use for email output.
* @param string $oldtarget Target name
* @param int $duration_value duration value
* @return int <0 if KO, >0 if OK
* @return int Int <0 if KO, >0 if OK
*/
function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value)
{

View File

@ -186,7 +186,7 @@ if ($resql) {
* @param string $userlang Code lang to use for email output.
* @param string $oldtarget Target name of sale representative
* @param int $duration_value Duration value
* @return int <0 if KO, >0 if OK
* @return int Int <0 if KO, >0 if OK
*/
function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value)
{

View File

@ -239,7 +239,7 @@ if ($resql) {
* @param string $total Total amount of unpayed invoices
* @param string $userlang Code lang to use for email output.
* @param string $oldtarget Target name
* @return int <0 if KO, >0 if OK
* @return int Int <0 if KO, >0 if OK
*/
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
{

View File

@ -195,7 +195,7 @@ if ($resql) {
* @param string $total Total amount of unpayed invoices
* @param string $userlang Code lang to use for email output.
* @param string $oldtarget Target name of sale representative
* @return int <0 if KO, >0 if OK
* @return int Int <0 if KO, >0 if OK
*/
function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
{

View File

@ -98,7 +98,7 @@ if (!isset($argv[2]) || !is_numeric($argv[2])) {
exit(-1);
}
$typeid = $argv[2];
$typeid = (int) $argv[2];
foreach ($argv as $key => $val) {
if ($val == 'commitiferror') {
$forcecommit = 1;