From 642810cb6d20965e16a0b2280368e15398b9398b Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 11:08:28 +0200 Subject: [PATCH 1/2] changing function name to the exisiting one --- htdocs/core/class/stats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ae9a8e56e58..ca6310aae9a 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -180,7 +180,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->getAmountByMonth($year, $format); + $datay[$year] = $this->_getAmountByMonth($year, $format); $year++; } From b713592c25a0b2a35bc463116ed89600bce363b7 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 14:00:24 +0200 Subject: [PATCH 2/2] adding abstract function to Stats class --- htdocs/core/class/stats.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index ca6310aae9a..188ecf1b429 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -123,6 +123,13 @@ abstract class Stats return $data; } + /** + * @param int $year year number + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return int value + */ + protected abstract function getAmountByMonth($year, $format = 0); + /** * Return amount of elements by month for several years. * Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php @@ -180,7 +187,7 @@ abstract class Stats $year = $year - 1; } while ($year <= $endyear) { - $datay[$year] = $this->_getAmountByMonth($year, $format); + $datay[$year] = $this->getAmountByMonth($year, $format); $year++; } @@ -460,7 +467,6 @@ abstract class Stats return $data; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Return the amount per month for a given year