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 Oct 14, 2024
1 parent 9de0f76 commit 5538801
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
13 changes: 7 additions & 6 deletions htdocs/core/class/commonstickergenerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ public function __construct($db)
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array $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 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
* @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 @@ -227,12 +227,12 @@ public function Add_PDF_label(&$pdf, $textleft, $header, $footer, $outputlangs,
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array $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 Expand Up @@ -337,7 +337,7 @@ public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $out

dolChmod($file);

$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);

return 1;
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ public function addSticker(&$pdf, $outputlangs, $param)
/**
* Function to build PDF on disk, then output on HTTP stream.
*
* @param array $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 Expand Up @@ -360,7 +360,7 @@ public function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $out

dolChmod($file);

$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);

return 1;
}
Expand Down

0 comments on commit 5538801

Please sign in to comment.