From 677109df41b5d6edbdd2ed0e6b2ab6c70297ba2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 13 Jan 2024 15:32:07 +0100 Subject: [PATCH] fix phpstan (#27483) * fix phpstan * fix phpstan --- htdocs/core/lib/pdf.lib.php | 7 +++---- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/product/doc/pdf_standard.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 2 +- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 +- .../core/modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- .../modules/supplier_order/doc/pdf_muscadet.modules.php | 2 +- .../modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- .../modules/supplier_proposal/doc/pdf_zenith.modules.php | 2 +- 14 files changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 01ad41b4d19..a005b91a4d4 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1007,7 +1007,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param int $showdetails Show company adress details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text * @param int $page_largeur Page width - * @param int $watermark Watermark text to print on page + * @param string $watermark Watermark text to print on page * @return int Return height of bottom margin including footer text */ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails = 0, $hidefreetext = 0, $page_largeur = 0, $watermark = '') @@ -2214,12 +2214,11 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param HookManager $hookmanager Hook manager instance * @return string Value for unit cell */ -function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false) +function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0) { - global $langs; + global $hookmanager, $langs; $reshook = 0; $result = ''; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 88de6414416..f23dfa2e731 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -469,7 +469,7 @@ class pdf_einstein extends ModelePDFCommandes // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index e02d239a5bd..2a532166c24 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -658,7 +658,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 818d157964b..9e5b38e1ccf 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -673,7 +673,7 @@ class pdf_crabe extends ModelePDFFactures // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0130fa8c0db..c14b98ae888 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -807,7 +807,7 @@ class pdf_sponge extends ModelePDFFactures // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 5d28341688f..f5cbe70f63e 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -429,7 +429,7 @@ class pdf_standard extends ModelePDFProduct // Unit if($conf->global->PRODUCT_USE_UNITS) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 53a2b63ec49..b13edcb00fb 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -582,7 +582,7 @@ class pdf_azur extends ModelePDFPropales // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index fcb5d64c92f..f5dabcf8507 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -671,7 +671,7 @@ class pdf_cyan extends ModelePDFPropales // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 8e2c7c64979..5fd36535f15 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -629,7 +629,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index a6bdd688a07..0a95fc48980 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -444,7 +444,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index a9146dd35e1..4203254fcc8 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -605,7 +605,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 1bbb8cbf623..ad4484c6ad0 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -505,7 +505,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e84248c114f..48f64d8b403 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -489,7 +489,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 8364b587e6d..5f15460fcd0 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -604,7 +604,7 @@ class pdf_zenith extends ModelePDFSupplierProposal // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); }