diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 3d5f2c9b640..ae35b74fad9 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -31,7 +31,7 @@ class FormIntervention * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -49,6 +49,7 @@ class FormIntervention } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a combo list with contracts qualified for a third party * @@ -59,9 +60,9 @@ class FormIntervention * @param int $showempty Show empty line * @return int Nbre of project if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1) { + // phpcs:enable global $db,$user,$conf,$langs; $out=''; diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index b4c5d770253..db233dda1b4 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -35,14 +35,15 @@ interface Database */ function ifsql($test, $resok, $resko); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_row($resultset); + function fetch_row($resultset); + // phpcs:enable /** * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. @@ -67,6 +68,7 @@ interface Database */ function begin(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -78,8 +80,8 @@ interface Database * @param string $owner Username of database owner * @return resource resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); + function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); + // phpcs:enable /** * Return version of database server into an array @@ -97,6 +99,7 @@ interface Database */ static function convertSQLFromMysql($line, $type = 'ddl'); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -104,8 +107,8 @@ interface Database * @return int Nombre de lignes * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function affected_rows($resultset); + function affected_rows($resultset); + // phpcs:enable /** * Return description of last error @@ -114,6 +117,7 @@ interface Database */ function error(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -121,8 +125,8 @@ interface Database * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLListTables($database, $table = ''); + function DDLListTables($database, $table = ''); + // phpcs:enable /** * Return last request executed with query() @@ -148,14 +152,15 @@ interface Database */ function decrypt($value); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_array($resultset); + function fetch_array($resultset); + // phpcs:enable /** * Return last error label @@ -172,6 +177,7 @@ interface Database */ function escape($stringtoencode); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -179,8 +185,8 @@ interface Database * @param string $fieldid Field name * @return int Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function last_insert_id($tab, $fieldid = 'rowid'); + function last_insert_id($tab, $fieldid = 'rowid'); + // phpcs:enable /** * Return full path of restore program @@ -253,6 +259,7 @@ interface Database */ function getDefaultCollationDatabase(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -260,8 +267,8 @@ interface Database * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function num_rows($resultset); + function num_rows($resultset); + // phpcs:enable /** * Return full path of dump program @@ -284,6 +291,7 @@ interface Database */ function errno(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -296,17 +304,18 @@ interface Database * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDropTable($table); + function DDLDropTable($table); + // phpcs:enable /** * Return list of available charset that can be used to store data in database @@ -315,6 +324,7 @@ interface Database */ function getListOfCharacterSet(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -324,9 +334,10 @@ interface Database * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLAddField($table, $field_name, $field_desc, $field_position = ""); + function DDLAddField($table, $field_name, $field_desc, $field_position = ""); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -334,9 +345,10 @@ interface Database * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDropField($table, $field_name); + function DDLDropField($table, $field_name); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -345,8 +357,8 @@ interface Database * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLUpdateField($table, $field_name, $field_desc); + function DDLUpdateField($table, $field_name, $field_desc); + // phpcs:enable /** * Return list of available collation that can be used for database @@ -355,6 +367,7 @@ interface Database */ function getListOfCollation(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -362,8 +375,8 @@ interface Database * @param string $field Optionnel : Name of field if we want description of field * @return resource Resource */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDescTable($table, $field = ""); + function DDLDescTable($table, $field = ""); + // phpcs:enable /** * Return version of database server @@ -379,6 +392,7 @@ interface Database */ function getDefaultCharacterSetDatabase(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user and privileges to connect to database (even if database does not exists yet) * @@ -388,13 +402,13 @@ interface Database * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser( $dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name - ); + ); + // phpcs:enable /** * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) @@ -425,14 +439,15 @@ interface Database */ function commit($log = ''); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * * @param string $table Name of table * @return array Array with inforation on table */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLInfoTable($table); + function DDLInfoTable($table); + // phpcs:enable /** * Free last resultset used. @@ -457,29 +472,32 @@ interface Database */ function lastqueryerror(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLGetConnectId(); + function DDLGetConnectId(); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param resource $resultset Curseur de la requete voulue * @return Object Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_object($resultset); + function fetch_object($resultset); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Select a database * * @param string $database Name of database * @return boolean true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function select_db($database); + function select_db($database); + // phpcs:enable } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 464bd7eed05..159f8664390 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -74,6 +74,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->tab_height = 200; //$this->line_height * $this->line_per_page; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction to generate document on disk * @@ -83,9 +84,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Lang output object * @return int 1=ok, 0=ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $_dir, $number, $outputlangs) { + // phpcs:enable global $user,$conf,$langs,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -198,6 +199,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Generate Header * @@ -207,9 +209,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Object language for output * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Header(&$pdf, $page, $pages, $outputlangs) { + // phpcs:enable global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -305,6 +307,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output array * @@ -314,9 +317,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Object lang * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Body(&$pdf, $pagenb, $pages, $outputlangs) { + // phpcs:enable // x=10 - Num // x=30 - Banque // x=100 - Emetteur diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9971c3acd81..2ca4300bb26 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -177,6 +177,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -188,9 +189,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 6c50b3c46de..665a6925c6b 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -37,7 +37,7 @@ class ExportExcel extends ModeleExports */ public $id; - /** + /** * @var string Export Excel label */ public $label; @@ -48,8 +48,8 @@ class ExportExcel extends ModeleExports public $label_lib; public $version_lib; - public $workbook; // Handle fichier - public $worksheet; // Handle onglet + public $workbook; // Handle file + public $worksheet; // Handle sheet public $row; public $col; public $file; // To save filename @@ -168,6 +168,7 @@ class ExportExcel extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open output file * @@ -175,9 +176,9 @@ class ExportExcel extends ModeleExports * @param Translate $outputlangs Output language object * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function open_file($file,$outputlangs) { + // phpcs:enable global $user,$conf,$langs; if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) @@ -238,21 +239,23 @@ class ExportExcel extends ModeleExports return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Write header + * Write header * - * @param Translate $outputlangs Object lang to translate values + * @param Translate $outputlangs Object lang to translate values * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header($outputlangs) { + // phpcs:enable //$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line into file * @@ -262,9 +265,9 @@ class ExportExcel extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { + // phpcs:enable global $conf; // Create a format for the column headings @@ -309,6 +312,7 @@ class ExportExcel extends ModeleExports return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record line into file * @@ -318,9 +322,9 @@ class ExportExcel extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { + // phpcs:enable global $conf; // Create a format for the column headings @@ -428,27 +432,29 @@ class ExportExcel extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write footer * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer($outputlangs) { + // phpcs:enable return 0; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Close Excel file * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_file() { + // phpcs:enable global $conf; if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) @@ -467,15 +473,16 @@ class ExportExcel extends ModeleExports } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Clean a cell to respect rules of Excel file cells * * @param string $newvalue String to clean * @return string Value cleaned */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function excel_clean($newvalue) { + // phpcs:enable // Rule Dolibarr: No HTML $newvalue=dol_string_nohtmltag($newvalue); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 623473d5595..a73d6f13296 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -176,6 +176,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -187,9 +188,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 9ac1d8bc6a6..31f09a7893f 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -38,9 +38,9 @@ class ImportXlsx extends ModeleImports */ public $db; - var $datatoimport; + public $datatoimport; - /** + /** * @var string Error code (or message) */ public $error=''; @@ -115,38 +115,40 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header_example($outputlangs) { - global $user,$conf,$langs; - // create a temporary object, the final output will be generated in footer - if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) { + // phpcs:enable + global $user,$conf,$langs; + // create a temporary object, the final output will be generated in footer + if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) { $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; $cacheSettings = array ( - 'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR - ); - PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); + 'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR + ); + PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); } - $this->workbook = new PHPExcel(); - $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); - $this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file); - $this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file); - $this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file); + $this->workbook = new PHPExcel(); + $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); + $this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file); + $this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file); + $this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file); - $this->workbook->setActiveSheetIndex(0); - $this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet")); - $this->workbook->getActiveSheet()->getDefaultRowDimension()->setRowHeight(16); + $this->workbook->setActiveSheetIndex(0); + $this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet")); + $this->workbook->getActiveSheet()->getDefaultRowDimension()->setRowHeight(16); - return ''; - } + return ''; + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line of an example file for this format * @@ -154,9 +156,9 @@ class ImportXlsx extends ModeleImports * @param array $headerlinefields Array of fields name * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title_example($outputlangs,$headerlinefields) { + // phpcs:enable global $conf; $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); @@ -172,6 +174,7 @@ class ImportXlsx extends ModeleImports return ''; // final output will be generated in footer } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record of an example file for this format * @@ -179,9 +182,9 @@ class ImportXlsx extends ModeleImports * @param array $contentlinevalues Array of lines * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record_example($outputlangs,$contentlinevalues) { + // phpcs:enable $col = 0; $row = 2; foreach($contentlinevalues as $cell) { @@ -192,16 +195,17 @@ class ImportXlsx extends ModeleImports return ''; // final output will be generated in footer } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer_example($outputlangs) { - // return te file content as a string + // phpcs:enable + // return the file content as a string $tempfile = tempnam(sys_get_temp_dir(), 'dol'); $objWriter = new PHPExcel_Writer_Excel2007($this->workbook); $objWriter->save($tempfile); @@ -215,15 +219,16 @@ class ImportXlsx extends ModeleImports + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open input file * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_open_file($file) { + // phpcs:enable global $langs; $ret=1; @@ -238,15 +243,16 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of records. File must be closed. * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_get_nb_of_lines($file) { + // phpcs:enable $reader = new PHPExcel_Reader_Excel2007(); $this->workbook = $reader->load($file); @@ -259,14 +265,15 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Input header line from file * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_header() { + // phpcs:enable // This is not called by the import code !!! $this->headers = array(); $colcount = PHPExcel_Cell::columnIndexFromString($this->workbook->getActiveSheet()->getHighestDataColumn()); @@ -277,14 +284,15 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of next record in input file. * * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_record() { + // phpcs:enable global $conf; $rowcount = $this->workbook->getActiveSheet()->getHighestDataRow(); @@ -301,19 +309,22 @@ class ImportXlsx extends ModeleImports return $array; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_close_file() { + // phpcs:enable $this->workbook->disconnectWorksheets(); unset($this->workbook); } + // What is this doing here ? it is common to all imports, is should be in the parent class + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert a record into database * @@ -325,10 +336,9 @@ class ImportXlsx extends ModeleImports * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor. * @return int <0 if KO, >0 if OK */ - // What is this doing here ? it is common to all imports, is should be in the parent class - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) { + // phpcs:enable global $langs,$conf,$user; global $thirdparty_static; // Specific to thirdparty import global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php index 4fed4689738..bad82554ff3 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php @@ -139,16 +139,17 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder } - /** - * Return next free ref - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return next free ref + * * @param Societe $objsoc Object thirdparty * @param Object $object Objet livraison * @return string Texte descripif */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function livraison_get_num($objsoc=0,$object='') { + // phpcs:enable return $this->getNextValue($objsoc,$object); } } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 59fc4f14039..f41992bee14 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -32,7 +32,7 @@ class mailing_advthirdparties extends MailingTargets var $require_module=array("none"); // This module should not be displayed as Selector in mailling var $picto='company'; - + /** * @var DoliDB Database handler. */ @@ -52,6 +52,7 @@ class mailing_advthirdparties extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -61,9 +62,9 @@ class mailing_advthirdparties extends MailingTargets * @param array $contactid Array of contact id to add * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target_spec($mailing_id,$socid,$type_of_target, $contactid) { + // phpcs:enable global $conf, $langs; dol_syslog(get_class($this)."::add_to_target socid=".var_export($socid,true).' contactid='.var_export($contactid,true)); diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 3202bf9ca1d..b632f387d05 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -39,16 +39,17 @@ abstract class ModelePDFProduct extends CommonDocGenerator public $error=''; - /** - * Return list of active generation modules - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='product'; @@ -140,6 +141,7 @@ abstract class ModeleProductCode return $langs->trans("NotAvailable"); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi la liste des modeles de numérotation * @@ -147,9 +149,9 @@ abstract class ModeleProductCode * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable $liste=array(); $sql =""; @@ -202,7 +204,7 @@ abstract class ModeleProductCode if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=' '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')'; $s.='
'; } - if ($type == 1) + elseif ($type == 1) { $s.=$langs->trans("RequiredIfService").': '; if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=''; @@ -210,7 +212,7 @@ abstract class ModeleProductCode if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=' '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')'; $s.='
'; } - if ($type == -1) + elseif ($type == -1) { $s.=$langs->trans("Required").': '; if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=''; @@ -239,14 +241,15 @@ abstract class ModeleProductCode return $s; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Check if mask/numbering use prefix * * @return int 0=no, 1=yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable return 0; } } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 1e0d084fbba..96bd6bfbfda 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -207,6 +207,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -218,9 +219,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 0c046746486..c7514ab973c 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -42,6 +42,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -49,9 +50,9 @@ abstract class ModelePDFPropales extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='propal'; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 801b3820bc5..154d37115dd 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -83,6 +83,7 @@ class pdf_paiement } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction generant la rapport sur le disque * @@ -92,9 +93,9 @@ class pdf_paiement * @param string $outputlangs Lang output object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($_dir, $month, $year, $outputlangs) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; global $conf, $hookmanager, $langs, $user; @@ -406,6 +407,7 @@ class pdf_paiement } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output body * @@ -415,9 +417,9 @@ class pdf_paiement * @param Translate $outputlangs Object langs * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Body(&$pdf, $page, $lines, $outputlangs) { + // phpcs:enable global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs);