From 2a9ef8dc0573ed0a907a3843915dce2ecec5bcbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 22:05:19 +0200 Subject: [PATCH] move phpcs:ignore --- .../class/accountingaccount.class.php | 19 ++++--- .../actions_adherentcard_common.class.php | 8 +-- .../actions_adherentcard_default.class.php | 6 ++- .../actions_contactcard_default.class.php | 10 ++-- .../core/class/emailsenderprofile.class.php | 26 ++++----- htdocs/core/class/html.formprojet.class.php | 11 ++-- htdocs/core/class/html.formsms.class.php | 3 +- htdocs/core/class/menu.class.php | 3 +- htdocs/core/modules/DolibarrModules.class.php | 54 ++++++++++++------- .../barcode/mod_barcode_product_standard.php | 6 ++- .../modules/fichinter/modules_fichinter.php | 6 ++- htdocs/core/modules/member/modules_cards.php | 6 ++- .../fourn/class/fournisseur.product.class.php | 25 +++++---- .../mailmanspip/class/mailmanspip.class.php | 17 +++--- .../canvas/actions_card_common.class.php | 12 +++-- .../actions_card_individual.class.php | 3 +- htdocs/website/class/websitepage.class.php | 17 +++--- 17 files changed, 140 insertions(+), 92 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c6848bfe68949..f2e2bbaf04caa 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -528,15 +528,16 @@ function info($id) } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Account deactivated * * @param int $id Id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function account_desactivate($id) { + // phpcs:enable $result = $this->checkUsage(); if ($result > 0) { @@ -562,15 +563,16 @@ function account_desactivate($id) } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Account activated * * @param int $id Id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function account_activate($id) { + // phpcs:enable $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; @@ -601,6 +603,7 @@ function getLibStatut($mode=0) return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -608,9 +611,9 @@ function getLibStatut($mode=0) * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->loadLangs(array("users")); @@ -620,27 +623,27 @@ function LibStatut($statut,$mode=0) if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 0) return $langs->trans('Disabled'); } - if ($mode == 1) + elseif ($mode == 1) { if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index fe91fc744363c..b84534af37a62 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -75,16 +75,17 @@ function getObject($id) //} } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @param int $id Id * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $conf, $langs, $user, $canvas; global $form, $formcompany, $objsoc; @@ -233,14 +234,15 @@ function assign_values(&$action, $id) } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign POST values into object * * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function assign_post() { + // phpcs:enable global $langs, $mysoc; $this->object->old_name = $_POST["old_name"]; diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index c5d6a89a15202..be7af41e894b8 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -67,6 +67,7 @@ private function getTitle($action) return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas * @@ -74,9 +75,9 @@ private function getTitle($action) * @param int $id Id * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $db, $langs, $user; global $form; @@ -121,6 +122,7 @@ function assign_values(&$action, $id) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -130,9 +132,9 @@ function assign_values(&$action, $id) * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf, $langs; //$this->getFieldList(); diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 566434c1d5a92..5831b943d768f 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -29,8 +29,8 @@ */ class ActionsContactCardDefault extends ActionsContactCardCommon { - /** - * Constructor + /** + * Constructor * * @param DoliDB $db Handler acces base de donnees * @param string $dirmodule Name of directory of module @@ -66,6 +66,7 @@ private function getTitle($action) return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas * @@ -73,9 +74,9 @@ private function getTitle($action) * @param int $id Id * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $db, $langs, $user; global $form; @@ -120,6 +121,7 @@ function assign_values(&$action, $id) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -129,9 +131,9 @@ function assign_values(&$action, $id) * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf, $langs; //$this->getFieldList(); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index ffff8ef1941f5..37685001abab3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -39,17 +39,17 @@ class EmailSenderProfile extends CommonObject * @var string ID to identify managed object */ public $element = 'emailsenderprofile'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_email_senderprofile'; - + /** * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for emailsenderprofile */ @@ -310,6 +310,7 @@ function getLibStatut($mode=0) return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -317,43 +318,36 @@ function getLibStatut($mode=0) * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { global $langs; - if ($mode == 0) - { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); - } - if ($mode == 1) + if ($mode == 0 || $mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 61c633c720b69..e9e1d8fe6c90d 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -33,7 +33,7 @@ class FormProjets * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -51,6 +51,7 @@ function __construct($db) return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a combo list with projects qualified for a third party / user * @@ -71,9 +72,9 @@ function __construct($db) * @param int $htmlid Html id to use instead of htmlname * @return string Return html content */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='') { + // phpcs:enable global $langs,$conf,$form; $out=''; @@ -119,6 +120,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen else return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array with projects qualified for a third party * @@ -139,9 +141,9 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen * @param string $morecss More CSS * @return int Nb of project if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500') { + // phpcs:enable global $user,$conf,$langs; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -470,6 +472,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build a HTML select list of element of same thirdparty to suggest to link them to project * @@ -480,9 +483,9 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, * @param string $projectkey Equivalent key to fk_projet for actual table_element * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") { + // phpcs:enable global $conf, $langs; if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 1db9fe4d3d85f..a549485ac4c21 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -88,6 +88,7 @@ function __construct($db) return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show the form to input an sms. * @@ -95,9 +96,9 @@ function __construct($db) * @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function show_form($morecss='titlefield', $showform=1) { + // phpcs:enable global $conf, $langs, $user, $form; if (! is_object($form)) $form=new Form($this->db); diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index b1ecbbf483cf8..3d9d92189a377 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -96,14 +96,15 @@ function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainme $this->liste=array_merge($array_start,$array_new,$array_end); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a menu entry from this->liste * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_last() { + // phpcs:enable if (count($this->liste) > 1) { array_pop($this->liste); } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 42be08bfe348d..c700b8c84a1e1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -999,6 +999,7 @@ function _unactive() } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create tables and keys required by module. * Files module.sql and module.key.sql with create table and create keys @@ -1008,9 +1009,9 @@ function _unactive() * @param string $reldir Relative directory where to scan files * @return int <=0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_tables($reldir) { + // phpcs:enable global $conf; $error=0; @@ -1118,6 +1119,7 @@ function _load_tables($reldir) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds boxes * @@ -1125,9 +1127,9 @@ function _load_tables($reldir) * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_boxes($option='') { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; global $conf; @@ -1218,14 +1220,15 @@ function insert_boxes($option='') } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes boxes * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_boxes() { + // phpcs:enable global $conf; $err=0; @@ -1294,14 +1297,15 @@ function delete_boxes() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds cronjobs * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_cronjobs() { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; global $conf; @@ -1408,14 +1412,15 @@ function insert_cronjobs() } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes boxes * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_cronjobs() { + // phpcs:enable global $conf; $err=0; @@ -1438,14 +1443,15 @@ function delete_cronjobs() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes tabs * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_tabs() { + // phpcs:enable global $conf; $err=0; @@ -1464,14 +1470,15 @@ function delete_tabs() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds tabs * * @return int Error count (0 if ok) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_tabs() { + // phpcs:enable global $conf; $err=0; @@ -1532,14 +1539,15 @@ function insert_tabs() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds constants * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_const() { + // phpcs:enable global $conf; $err=0; @@ -1602,14 +1610,15 @@ function insert_const() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes constants tagged 'deleteonunactive' * * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_const() { + // phpcs:enable global $conf; $err=0; @@ -1638,6 +1647,7 @@ function delete_const() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds access rights * @@ -1646,9 +1656,9 @@ function delete_const() * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0) { + // phpcs:enable global $conf,$user; $err=0; @@ -1794,14 +1804,15 @@ function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger= } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes access rights * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_permissions() { + // phpcs:enable global $conf; $err=0; @@ -1820,14 +1831,15 @@ function delete_permissions() } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds menu entries * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_menus() { + // phpcs:enable global $user; if (! is_array($this->menu) || empty($this->menu)) return 0; @@ -1930,14 +1942,15 @@ function insert_menus() } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes menu entries * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_menus() { + // phpcs:enable global $conf; $err=0; @@ -1960,14 +1973,15 @@ function delete_menus() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Creates directories * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_dirs() { + // phpcs:enable global $langs, $conf; $err=0; @@ -2019,6 +2033,7 @@ function create_dirs() } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds directories definitions * @@ -2027,9 +2042,9 @@ function create_dirs() * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_dirs($name,$dir) { + // phpcs:enable global $conf; $err=0; @@ -2064,14 +2079,15 @@ function insert_dirs($name,$dir) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes directories * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_dirs() { + // phpcs:enable global $conf; $err=0; @@ -2090,14 +2106,15 @@ function delete_dirs() return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds generic parts * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_module_parts() { + // phpcs:enable global $conf; $error=0; @@ -2169,14 +2186,15 @@ function insert_module_parts() return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes generic parts * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_module_parts() { + // phpcs:enable global $conf; $err=0; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index bd61dab4ff499..42ce154c648df 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -223,6 +223,7 @@ function verif($db, &$code, $product, $thirdparty_type, $type) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if a code is used (by other element) * @@ -231,9 +232,9 @@ function verif($db, &$code, $product, $thirdparty_type, $type) * @param Product $product Objet product * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $product) { + // phpcs:enable $sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE barcode = '".$code."'"; if ($product->id > 0) $sql.= " AND rowid <> ".$product->id; @@ -256,6 +257,7 @@ function verif_dispo($db, $code, $product) } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if a barcode value match syntax * @@ -263,9 +265,9 @@ function verif_dispo($db, $code, $product) * @param string $typefortest Type of barcode (ISBN, EAN, ...) * @return int 0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_syntax($codefortest, $typefortest) { + // phpcs:enable global $conf; $result = 0; diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index bc08063ea2145..2d3c4bebfe6a5 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -40,6 +40,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -47,9 +48,9 @@ abstract class ModelePDFFicheinter 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='ficheinter'; @@ -148,6 +149,7 @@ function getVersion() } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF * @@ -160,9 +162,9 @@ function getVersion() * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable global $conf,$langs,$user; $langs->load("ficheinter"); diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index b1dc86d4e4d62..c931abce4edd2 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -40,6 +40,7 @@ class ModelePDFCards public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -47,9 +48,9 @@ class ModelePDFCards * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='member'; @@ -63,6 +64,7 @@ function liste_modeles($db,$maxfilenamelength=0) } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF * @@ -74,9 +76,9 @@ function liste_modeles($db,$maxfilenamelength=0) * @param string $template pdf generenate document class to use default 'standard' * @return int <0 if KO, >0 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir='', $template='standard') { + // phpcs:enable global $conf,$langs; $langs->load("members"); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 77a31689237c5..57502a52365a6 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -41,7 +41,7 @@ class ProductFournisseur extends Product * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -53,7 +53,7 @@ class ProductFournisseur extends Product * @var int ID */ public $id; - + /** * @deprecated * @see ref_supplier @@ -104,15 +104,16 @@ function __construct($db) + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove all prices for this couple supplier-product * * @param int $id_fourn Supplier Id * @return int < 0 if error, > 0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_fournisseur($id_fourn) { + // phpcs:enable $ok=1; $this->db->begin(); @@ -141,15 +142,16 @@ function remove_fournisseur($id_fourn) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a price for a couple supplier-product * * @param int $rowid Line id of price * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_product_fournisseur_price($rowid) { + // phpcs:enable global $conf, $user; $error=0; @@ -186,6 +188,7 @@ function remove_product_fournisseur_price($rowid) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Modify the purchase price for a supplier * @@ -212,9 +215,9 @@ function remove_product_fournisseur_price($rowid) * @param string $desc_fourn Custom description for product_fourn_price * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0, $delivery_time_days=0, $supplier_reputation='', $localtaxes_array=array(), $newdefaultvatcode='', $multicurrency_buyprice=0, $multicurrency_price_base_type='HT',$multicurrency_tx=1,$multicurrency_code='', $desc_fourn='') { + // phpcs:enable global $conf, $langs; //global $mysoc; @@ -441,6 +444,7 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Loads the price information of a provider * @@ -448,9 +452,9 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai * @param int $ignore_expression Ignores the math expression for calculating price and uses the db value instead * @return int < 0 if KO, 0 if OK but not found, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) { + // phpcs:enable global $conf; $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; @@ -529,6 +533,7 @@ function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List all supplier prices of a product * @@ -539,9 +544,9 @@ function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) * @param int $offset Offset * @return array Array of Products with new properties to define supplier price */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $limit=0, $offset=0) { + // phpcs:enable global $conf; $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; @@ -630,6 +635,7 @@ function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $ } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load properties for minimum price * @@ -638,9 +644,9 @@ function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $ * @param int $socid get min price for specific supplier * @return int <0 if KO, 0=Not found of no product id provided, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function find_min_price_product_fournisseur($prodid, $qty=0, $socid=0) { + // phpcs:enable global $conf; if (empty($prodid)) @@ -818,6 +824,7 @@ function getSocNomUrl($withpicto=0,$option='supplier',$maxlen=0,$notooltip=0) return $thirdparty->getNomUrl($withpicto,$option,$maxlen,$notooltip); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Display price of product * @@ -829,9 +836,9 @@ function getSocNomUrl($withpicto=0,$option='supplier',$maxlen=0,$notooltip=0) * to display in table format. * @return string String with supplier price */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { + // phpcs:enable global $langs; $out = ''; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index c33e015ec7912..139183e03759e 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -42,7 +42,7 @@ class MailmanSpip * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -170,15 +170,16 @@ private function callMailman($object, $url, $list) return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui donne les droits redacteurs dans spip * * @param Adherent $object Object with data (->firstname, ->lastname, ->email and ->login) * @return int =0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_spip($object) { + // phpcs:enable dol_syslog(get_class($this)."::add_to_spip"); if ($this->isSpipEnabled()) @@ -213,15 +214,16 @@ function add_to_spip($object) return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui enleve les droits redacteurs dans spip * * @param Adherent $object Object with data (->login) * @return int =0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_spip($object) { + // phpcs:enable dol_syslog(get_class($this)."::del_to_spip"); if ($this->isSpipEnabled()) @@ -253,15 +255,16 @@ function del_to_spip($object) return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui dit si cet utilisateur est un redacteur existant dans spip * * @param object $object Object with data (->login) * @return int 1=exists, 0=does not exists, -1=error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_in_spip($object) { + // phpcs:enable if ($this->isSpipEnabled()) { if ($this->checkSpipConfig()) @@ -304,6 +307,7 @@ function is_in_spip($object) return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Subscribe an email to all mailing-lists * @@ -311,9 +315,9 @@ function is_in_spip($object) * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_mailman($object,$listes='') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::add_to_mailman"); @@ -376,6 +380,7 @@ function add_to_mailman($object,$listes='') } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Unsubscribe an email from all mailing-lists * Used when a user is resiliated @@ -384,9 +389,9 @@ function add_to_mailman($object,$listes='') * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_mailman($object,$listes='') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::del_to_mailman"); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 30b1667afcfde..2577f5bed5d5d 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -31,7 +31,7 @@ abstract class ActionsCardCommon * @var DoliDB Database handler. */ public $db; - + var $dirmodule; var $targetmodule; var $canvas; @@ -41,12 +41,12 @@ abstract class ActionsCardCommon var $tpl = array(); //! Object container var $object; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) @@ -70,6 +70,7 @@ protected function getObject($id,$ref='') $this->object = $object; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -78,9 +79,9 @@ protected function getObject($id,$ref='') * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $conf, $langs, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; @@ -370,15 +371,16 @@ function assign_values(&$action, $id=0, $ref='') } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign POST values into object * * @param string $action Action string * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function assign_post($action) { + // phpcs:enable global $langs, $mysoc; $this->object->id = $_POST["socid"]; diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index c662ce2ae6f5c..5fd7ee01faf45 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -84,6 +84,7 @@ function doActions(&$action, $id) return $return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -92,9 +93,9 @@ function doActions(&$action, $id) * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $conf, $langs; global $form, $formcompany; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 4b313808e0dec..3f446f13a5b15 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -39,12 +39,12 @@ class WebsitePage extends CommonObject * @var string Id to identify managed objects */ public $element = 'websitepage'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website_page'; - + /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ @@ -467,6 +467,7 @@ function getLibStatut($mode=0) return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * @@ -474,9 +475,9 @@ function getLibStatut($mode=0) * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) @@ -485,27 +486,27 @@ function LibStatut($status,$mode=0) if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 1) + elseif ($mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');