From 00903a7672ede3c852aba0c651bfd0f4eda15ab2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2024 20:55:40 +0100 Subject: [PATCH] Fix phpstan --- htdocs/core/modules/societe/mod_codeclient_elephant.php | 2 ++ htdocs/core/modules/societe/mod_codeclient_leopard.php | 5 ++--- htdocs/core/modules/societe/mod_codeclient_monkey.php | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index fdc1f870c41..76b6696a772 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -94,6 +94,8 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 0; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 18bb5dcf5fe..6e9b1a459f9 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -70,6 +70,8 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 1; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; @@ -112,7 +114,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function getNextValue($objsoc = 0, $type = -1) { - global $langs; return ''; } @@ -132,8 +133,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function verif($db, &$code, $soc, $type) { - global $conf; - $result = 0; $code = trim($code); diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 5e788514204..21afc7206b6 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -70,6 +70,8 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 1; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; @@ -114,7 +116,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function getNextValue($objsoc = 0, $type = -1) { - global $db, $conf, $mc; + global $db; $field = ''; $prefix = ''; @@ -178,8 +180,6 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function verif($db, &$code, $soc, $type) { - global $conf; - $result = 0; $code = strtoupper(trim($code)); @@ -222,8 +222,6 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode public function verif_dispo($db, $code, $soc, $type = 0) { // phpcs:enable - global $conf, $mc; - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; if ($type == 1) { $sql .= " WHERE code_fournisseur = '".$db->escape($code)."'";