Skip to content

Commit

Permalink
Qual: Update phpdoc write_file for CommonStickerGenerator classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Nov 11, 2024
1 parent fb80142 commit 91cb1be
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
9 changes: 5 additions & 4 deletions htdocs/core/class/commonstickergenerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ public function __construct($db)
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array<string,mixed> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Adherent|array<array{textleft:string,textheader:string,textfooter:string,textright:string,id:string,photo:string}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param string $outputdir Output directory for pdf file
* @return int 1=OK, 0=KO
* @param string $outputdir Output directory for pdf file
* @param string $filename Short file name of output file
* @return int<-1,1> 1=OK, <=0=KO
*/
abstract public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = '');
abstract public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = '', $filename = '');
// phpcs:enable

/**
Expand Down
18 changes: 9 additions & 9 deletions htdocs/core/modules/member/doc/pdf_standard_member.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,17 +262,17 @@ public function Add_PDF_card(&$pdf, $textleft, $header, $footer, $outputlangs, $

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to build PDF on disk, then output on HTTP stream.
* Function to build PDF on disk, then output on HTTP stream.
*
* @param Adherent|array $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ...
* @param string $mode Tell if doc module is called for 'member', ...
* @param int $nooutput 1=Generate only file on disk and do not return it on response
* @param string $filename Name of output file (without extension)
* @return int 1=OK, 0=KO
* @param Adherent|array<array{textleft:string,textheader:string,textfooter:string,textright:string,id:string,photo:string}> $object Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath file. Example: '5161', 'AVERYC32010', 'CARD', ...
* @param string $mode Tell if doc module is called
* @param string $nooutput 1=Generate only file on disk and do not return it on response // TODO: Fix not compatible parameter signature.
* @param string $filename Name of output file (without extension)
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = 0, $filename = 'tmp_cards')
public function write_file($object, $outputlangs, $srctemplatepath, $mode = 'member', $nooutput = '', $filename = 'tmp_cards')
{
// phpcs:enable
global $user, $conf, $langs, $mysoc, $_Avery_Labels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ public function Add_PDF_label(&$pdf, $textleft, $header, $footer, $outputlangs,
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array<array{textleft:string,textheader:string,textfooter:string,textright:string,photo:string}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param array<array{textleft:string,textheader:string,textfooter:string,textright:string,id:string,photo:string}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param string $outputdir Output directory for pdf file
* @param string $filename Short file name of PDF output file
* @return int 1=OK, 0=KO
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = '', $filename = 'tmp_address_sheet.pdf')
{
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ public function addSticker(&$pdf, $outputlangs, $param)
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array<array{textleft:string,textheader:string,textfooter:string,textright:string,code:string,encoding:string,is2d:int<0,1>|bool}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* REMINDER param array<array{textleft:string,textheader:string,textfooter:string,textright:string,code:string,encoding:string,is2d:int<0,1>|bool}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param array<array{textleft:string,textheader:string,textfooter:string,textright:string,id:string,photo:string}> $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>)
* @param Translate $outputlangs Lang object for output language
* @param string $srctemplatepath Full path of source filename for generator using a template file
* @param string $outputdir Output directory for pdf file
* @param string $filename Short file name of PDF output file
* @return int 1=OK, 0=KO
* @return int<-1,1> 1=OK, <=0=KO
*/
public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = '', $filename = 'tmp_address_sheet.pdf')
{
Expand Down

0 comments on commit 91cb1be

Please sign in to comment.