From 2c6e4227910f2687e0dc5eeaeb95ca752d1d92b1 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Tue, 14 Jun 2022 11:06:10 +0200 Subject: [PATCH 1/3] changing function name to existing 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..91d3d729c2f 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -236,7 +236,7 @@ abstract class Stats $year = $startyear; while ($year <= $endyear) { - $datay[$year] = $this->getAverageByMonth($year); + $datay[$year] = $this->_getAverageByMonth($year); $year++; } From fc4f5d9af214e0e8af36ca2b48a2beb58b352d54 Mon Sep 17 00:00:00 2001 From: NASDAMI Quatadah Date: Wed, 15 Jun 2022 12:25:00 +0200 Subject: [PATCH 2/3] adding abstract function in Stats class --- htdocs/core/class/stats.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 91d3d729c2f..38effddb586 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -219,6 +219,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 getAverageByMonth($year, $format = 0); + /** * Return average of entity by month for several years * @@ -236,7 +243,7 @@ abstract class Stats $year = $startyear; while ($year <= $endyear) { - $datay[$year] = $this->_getAverageByMonth($year); + $datay[$year] = $this->getAverageByMonth($year); $year++; } From 10f2501ad25a22fd847fac657416b4b06ff5cfc5 Mon Sep 17 00:00:00 2001 From: Quatadah Nasdami Date: Thu, 23 Jun 2022 17:58:18 +0200 Subject: [PATCH 3/3] removing useless parameter in abstract method --- htdocs/core/class/stats.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 38effddb586..7e870857251 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -220,11 +220,10 @@ abstract class Stats } /** - * @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 + * @param int $year year number * @return int value */ - protected abstract function getAverageByMonth($year, $format = 0); + protected abstract function getAverageByMonth($year); /** * Return average of entity by month for several years