From f19fc5c70ce7bc70f116e186fa5d6fadfb76ed7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Mon, 11 Mar 2024 18:18:59 +0100 Subject: [PATCH] clean code and phpdoc --- htdocs/core/modules/fichinter/mod_arctic.php | 5 +++-- htdocs/core/modules/fichinter/mod_pacific.php | 11 ++++++----- .../holiday/mod_holiday_immaculate.php | 16 +--------------- .../modules/holiday/mod_holiday_madonna.php | 19 ++----------------- .../modules/hrm/mod_evaluation_advanced.php | 4 ++-- .../modules/hrm/mod_evaluation_standard.php | 5 +++-- 6 files changed, 17 insertions(+), 43 deletions(-) diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 4e23b6cb1e3..54362d39bd4 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,7 +122,7 @@ class mod_arctic extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc = 0, $object = '') @@ -148,7 +149,7 @@ class mod_arctic extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search + * @param Fichinter $objforref Object for number to search * @return string|0 Next free value, 0 if KO */ public function getNumRef($objsoc, $objforref) diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php index 1892d9f3759..a1f90012125 100644 --- a/htdocs/core/modules/fichinter/mod_pacific.php +++ b/htdocs/core/modules/fichinter/mod_pacific.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,7 +83,7 @@ class mod_pacific extends ModeleNumRefFicheinter * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -121,7 +122,7 @@ class mod_pacific extends ModeleNumRefFicheinter * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Fichinter $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc = 0, $object = '') @@ -161,9 +162,9 @@ class mod_pacific extends ModeleNumRefFicheinter /** * Return next free value * - * @param Societe $objsoc Object third party - * @param Object $objforref Object for number to search - * @return string Next free value + * @param Societe $objsoc Object third party + * @param Fichinter $objforref Object for number to search + * @return string Next free value */ public function getNumRef($objsoc, $objforref) { diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index ca246324929..434b9614985 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -105,7 +105,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays * Return next value * * @param Societe $objsoc third party object - * @param Object $holiday holiday object + * @param Holiday $holiday holiday object * @return string|0 Value if OK, 0 if KO */ public function getNextValue($objsoc, $holiday) @@ -125,18 +125,4 @@ class mod_holiday_immaculate extends ModelNumRefHolidays return $numFinal; } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param User $fuser User object - * @param Object $objforref Holiday object - * @return string|0 Value if OK, 0 if KO - */ - public function holiday_get_num($fuser, $objforref) - { - // phpcs:enable - return $this->getNextValue($fuser, $objforref); - } } diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index d2eeceeafc2..636ee4269d3 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -77,7 +77,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays /** * Test if existing numbers make problems with numbering * - * @param Object $object Object we need next value for + * @param Holiday $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -114,7 +114,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays * Return next value * * @param Societe $objsoc third party object - * @param Object $holiday Holiday object + * @param Holiday $holiday Holiday object * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($objsoc, $holiday) @@ -152,19 +152,4 @@ class mod_holiday_madonna extends ModelNumRefHolidays dol_syslog("mod_holiday_madonna::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } - - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next value - * - * @param User $fuser User object - * @param Object $objforref Holiday object - * @return string|-1 Value if OK, -1 if KO - */ - public function holiday_get_num($fuser, $objforref) - { - // phpcs:enable - return $this->getNextValue($fuser, $objforref); - } } diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index 2c89930a5ab..78d396d909b 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -123,7 +123,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return string|0 Value if OK, 0 if KO */ public function getNextValue($object) diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index 17cb75ad4ea..418b7b1e5ba 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,7 +78,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation * Checks if the numbers already in the database do not * cause conflicts that would prevent this numbering working. * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return boolean false if conflict, true if ok */ public function canBeActivated($object) @@ -117,7 +118,7 @@ class mod_evaluation_standard extends ModeleNumRefEvaluation /** * Return next free value * - * @param Object $object Object we need next value for + * @param Evaluation $object Object we need next value for * @return string|-1 Value if OK, -1 if KO */ public function getNextValue($object)