Fix: Update type hints in PDF modules (#39226)

# Fix: Update type hints in PDF modules

- Fix `Parameter #4 $curY of method pdf_standard_evaluation::printLine() expects int, float given.`
- Updated some other type hints
- Removed unnecessary reference symbols (&) from method parameters

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
MDW 2026-07-24 04:13:07 +02:00 committed by GitHub
parent 1693f8a8a4
commit bc9985ba5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 18 deletions

View file

@ -7,7 +7,7 @@
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2019 Rafael Ingenleuf <ingenleuf@welters.de>
* Copyright (C) 2020 Marc Guenneugues <marc.guenneugues@simicar.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
@ -572,13 +572,13 @@ class pdf_standard_expensereport extends ModeleExpenseReport
* @param TCPDF $pdf Object PDF
* @param ExpenseReport $object Object to show
* @param int $linenumber line number
* @param int $curY current y position
* @param float $curY current y position
* @param int $default_font_size default font size
* @param Translate $outputlangs Object lang for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void
*/
protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
protected function printLine($pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
{
global $conf;
$pdf->SetFont('', '', $default_font_size - 1);
@ -661,11 +661,11 @@ class pdf_standard_expensereport extends ModeleExpenseReport
*
* @param TCPDF $pdf Object PDF
* @param ExpenseReport $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param int<0,1> $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return float|int Return topshift value
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
protected function _pagehead($pdf, $object, $showaddress, $outputlangs)
{
// global $conf, $langs, $hookmanager;
global $user, $langs, $conf, $mysoc, $db, $hookmanager;
@ -914,7 +914,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport
* @param string $currency Currency code
* @return void
*/
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
protected function _tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
{
global $conf;
@ -1032,7 +1032,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport
* @param Translate $outputlangs Object langs for output
* @return int Return integer <0 if KO, >0 if OK
*/
protected function tablePayments(&$pdf, $object, $posy, $outputlangs)
protected function tablePayments($pdf, $object, $posy, $outputlangs)
{
global $conf;
@ -1143,7 +1143,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text
*/
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
protected function _pagefoot($pdf, $object, $outputlangs, $hidefreetext = 0)
{
$showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
return pdf_pagefoot($pdf, $outputlangs, 'EXPENSEREPORT_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);

View file

@ -7,7 +7,7 @@
* Copyright (C) 2019 Markus Welters <markus@welters.de>
* Copyright (C) 2019 Rafael Ingenleuf <ingenleuf@welters.de>
* Copyright (C) 2020 Marc Guenneugues <marc.guenneugues@simicar.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Nick Fragoulis
*
* This program is free software; you can redistribute it and/or modify
@ -494,13 +494,13 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
* @param TCPDF $pdf Object PDF
* @param Evaluation $object Object to show
* @param int $linenumber line number
* @param int $curY current y position
* @param float $curY current y position
* @param int $default_font_size default font size
* @param Translate $outputlangs Object lang for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void
*/
protected function printLine(&$pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
protected function printLine($pdf, $object, $linenumber, $curY, $default_font_size, $outputlangs, $hidedetails = 0)
{
$objectligne = $object->lines[$linenumber];
$pdf->SetFont('', '', $default_font_size - 1);
@ -583,11 +583,11 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
*
* @param TCPDF $pdf Object PDF
* @param Evaluation $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param int<0,1> $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return float|int Return topshift value
* @return float Return topshift value
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
protected function _pagehead($pdf, $object, $showaddress, $outputlangs)
{
// global $conf, $langs, $hookmanager;
global $user, $langs, $conf, $mysoc, $db, $hookmanager;
@ -708,7 +708,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
* @param string $currency Currency code
* @return void
*/
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
protected function _tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
{
global $conf;
@ -780,7 +780,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text
*/
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
protected function _pagefoot($pdf, $object, $outputlangs, $hidefreetext = 0)
{
$showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
return pdf_pagefoot($pdf, $outputlangs, '', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);