2
0
forked from Wavyzz/dolibarr

fix phpstan (#31061)

* fix phpstan

* fix phpstan
This commit is contained in:
Frédéric FRANCE
2024-09-20 17:25:39 +02:00
committed by GitHub
parent c8a1ac578d
commit 13d4d96dfc
13 changed files with 24 additions and 22 deletions

View File

@@ -705,7 +705,7 @@ if (empty($reshook)) {
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}

View File

@@ -1169,7 +1169,7 @@ class Commande extends CommonOrder
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
}
} else {
dol_print_error($this->db, $resqlcontact);
dol_print_error($this->db);
}
}

View File

@@ -821,7 +821,7 @@ class Facture extends CommonInvoice
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
}
} else {
dol_print_error($this->db, $resqlcontact);
dol_print_error($this->db);
}
}

View File

@@ -1159,7 +1159,7 @@ class Contrat extends CommonObject
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
}
} else {
dol_print_error($this->db, $resqlcontact);
dol_print_error($this->db);
}
}
}

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -71,7 +72,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel',
}
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}

View File

@@ -4093,7 +4093,7 @@ class Form
'type' => $outtype,
'duration_value' => $outdurationvalue,
'duration_unit' => $outdurationunit,
'disabled' => (empty($objp->idprodfournprice) ? true : false),
'disabled' => empty($objp->idprodfournprice),
'description' => $objp->description
);
if (isModEnabled('multicurrency')) {

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -165,7 +166,7 @@ if ($action == 'add' && $permissiontoadd) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}

View File

@@ -506,7 +506,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
@@ -884,7 +884,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
@@ -975,7 +975,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
$error++;
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
} else {

View File

@@ -260,7 +260,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}
@@ -1833,7 +1833,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
@@ -1933,7 +1933,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
@@ -1978,7 +1978,7 @@ if (empty($reshook)) {
$object->fetch_thirdparty();
$result = $object->update_price(0, (($calculationrule == 'totalofround') ? '0' : '1'), 0, $object->thirdparty);
if ($result <= 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
exit;
}
}

View File

@@ -462,7 +462,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}
@@ -509,7 +509,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
}

View File

@@ -10,7 +10,7 @@
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
@@ -483,7 +483,7 @@ if (empty($reshook)) {
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}
@@ -893,7 +893,7 @@ if (empty($reshook)) {
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $result);
dol_print_error($db, $object->error, $object->errors);
}
}

View File

@@ -102,7 +102,7 @@ parameters:
- '#( |::)((multi)?selectarray)\(\) expects array#'
- '# (reWriteAllMenus|check_authentication) expects array#'
- '#::(_validateMyObject|select_company)\(\) expects array<string#'
- '# (dol_print_error|dolGetButtonTitle) expects array<string#'
- '# dolGetButtonTitle expects array<string#'
- '# getNav expects array#'
- '# getCommonSubstitutionArray expects array#'
- '# ajax_constantonoff expects array, null given.#'