Fix phpcs

This commit is contained in:
Laurent Destailleur 2019-04-08 18:02:27 +02:00
parent 7b01e76d2b
commit d01b54ca5b
4 changed files with 97 additions and 105 deletions

View File

@ -1080,7 +1080,7 @@ abstract class CommonDocGenerator
* @param int $hidetop Hide top * @param int $hidetop Hide top
* @return float Height of col tab titles * @return float Height of col tab titles
*/ */
function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0) public function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0)
{ {
global $hookmanager; global $hookmanager;

View File

@ -139,9 +139,7 @@ class pdf_espadon extends ModelePdfExpedition
$this->emetteur=$mysoc; $this->emetteur=$mysoc;
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined
$this->tabTitleHeight = 5; // default height $this->tabTitleHeight = 5; // default height
} }
/** /**
@ -660,7 +658,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @return int Position pour suite * @return int Position pour suite
*/ */
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) public function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{ {
// phpcs:enable // phpcs:enable
global $conf,$mysoc; global $conf,$mysoc;
@ -728,7 +726,6 @@ class pdf_espadon extends ModelePdfExpedition
$y = $tab2_top + ($tab2_hl * $index); $y = $tab2_top + ($tab2_hl * $index);
$this->printStdColumnContent($pdf, $y, 'weight', $totalVolumetoshow); $this->printStdColumnContent($pdf, $y, 'weight', $totalVolumetoshow);
} }
} }
if ($this->getColumnStatus('qty_asked') && $totalOrdered) if ($this->getColumnStatus('qty_asked') && $totalOrdered)
@ -763,7 +760,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param int $hidebottom Hide bottom bar of array * @param int $hidebottom Hide bottom bar of array
* @return void * @return void
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) public function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
{ {
global $conf; global $conf;
@ -1074,8 +1071,8 @@ class pdf_espadon extends ModelePdfExpedition
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return null
*/ */
function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
global $conf, $hookmanager; global $conf, $hookmanager;
// Default field style for content // Default field style for content

View File

@ -269,7 +269,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir); $this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
return 0; return 0;
} }
} }
if (file_exists($dir)) if (file_exists($dir))
@ -640,7 +639,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$parameters=array( $parameters=array(
'object' => $object, 'object' => $object,21
'i' => $i, 'i' => $i,
'pdf' =>& $pdf, 'pdf' =>& $pdf,
'curY' =>& $curY, 'curY' =>& $curY,
@ -1628,7 +1627,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
{ {
$this->cols = $hookmanager->resArray; $this->cols = $hookmanager->resArray;
} }
} }
/* /*
@ -1645,8 +1643,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param array $b PDF lines array fields configs * @param array $b PDF lines array fields configs
* @return int Return compare result * @return int Return compare result
*/ */
function columnSort($a, $b) { public function columnSort($a, $b)
{
if(empty($a['rank'])){ $a['rank'] = 0; } if(empty($a['rank'])){ $a['rank'] = 0; }
if(empty($b['rank'])){ $b['rank'] = 0; } if(empty($b['rank'])){ $b['rank'] = 0; }
if ($a['rank'] == $b['rank']) { if ($a['rank'] == $b['rank']) {
@ -1666,13 +1664,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return null * @return null
*/ */
function prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0){ public function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
global $conf; global $conf;
$this->defineColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref); $this->defineColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
// Sorting // Sorting
uasort($this->cols, array($this, 'columnSort')); uasort($this->cols, array($this, 'columnSort'));
@ -1742,7 +1739,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param string $colKey the column key * @param string $colKey the column key
* @return float width in mm * @return float width in mm
*/ */
function getColumnContentWidth($colKey) public function getColumnContentWidth($colKey)
{ {
$colDef = $this->cols[$colKey]; $colDef = $this->cols[$colKey];
return $colDef['width'] - $colDef['content']['padding'][3] - $colDef['content']['padding'][1]; return $colDef['width'] - $colDef['content']['padding'][3] - $colDef['content']['padding'][1];
@ -1755,7 +1752,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param string $colKey the column key * @param string $colKey the column key
* @return float X position in mm * @return float X position in mm
*/ */
function getColumnContentXStart($colKey) public function getColumnContentXStart($colKey)
{ {
$colDef = $this->cols[$colKey]; $colDef = $this->cols[$colKey];
return $colDef['xStartPos'] + $colDef['content']['padding'][3]; return $colDef['xStartPos'] + $colDef['content']['padding'][3];
@ -1767,7 +1764,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param string $colKey the column key * @param string $colKey the column key
* @return int rank on success and -1 on error * @return int rank on success and -1 on error
*/ */
function getColumnRank($colKey) public function getColumnRank($colKey)
{ {
if(!isset($this->cols[$colKey]['rank'])) return -1; if(!isset($this->cols[$colKey]['rank'])) return -1;
return $this->cols[$colKey]['rank']; return $this->cols[$colKey]['rank'];
@ -1782,7 +1779,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param bool $insertAfterTarget insert before or after target column ? * @param bool $insertAfterTarget insert before or after target column ?
* @return int new rank on success and -1 on error * @return int new rank on success and -1 on error
*/ */
function insertNewColumnDef($newColKey, $defArray, $targetCol = false, $insertAfterTarget = false) public function insertNewColumnDef($newColKey, $defArray, $targetCol = false, $insertAfterTarget = false)
{ {
// prepare wanted rank // prepare wanted rank
$rank = -1; $rank = -1;
@ -1825,7 +1822,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param string $columnText column text * @param string $columnText column text
* @return int new rank on success and -1 on error * @return int new rank on success and -1 on error
*/ */
function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '') public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{ {
global $hookmanager; global $hookmanager;
@ -1844,17 +1841,15 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$colDef = $this->cols[$colKey]; $colDef = $this->cols[$colKey];
$pdf->MultiCell($this->getColumnContentWidth($colKey), 2, $columnText, '', $colDef['content']['align']); $pdf->MultiCell($this->getColumnContentWidth($colKey), 2, $columnText, '', $colDef['content']['align']);
} }
} }
/** /**
* get column status from column key * get column status from column key
* *
* @param string $colKey the column key * @param string $colKey the column key
* @return float width in mm * @return float width in mm
*/ */
function getColumnStatus($colKey) public function getColumnStatus($colKey)
{ {
if( !empty($this->cols[$colKey]['status'])){ if( !empty($this->cols[$colKey]['status'])){
return true; return true;