From f99c8d5f54c67e0abc3f3189b4f5e3e4571e114c Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:04:06 +0200 Subject: Modernize code to php7.4 (#6043) * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Consistency --------- Co-authored-by: Luc Co-authored-by: Alexandre Alapetite --- app/Models/StatsDAO.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/Models/StatsDAO.php') diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php index 9bdc255e3..3ee481776 100644 --- a/app/Models/StatsDAO.php +++ b/app/Models/StatsDAO.php @@ -222,7 +222,7 @@ SQL; $interval_in_days = $period; } - return intval($res[0]['count']) / ($interval_in_days / $period); + return (int)$res[0]['count'] / ($interval_in_days / $period); } /** @@ -230,9 +230,7 @@ SQL; * @return array */ protected function initStatsArray(int $min, int $max): array { - return array_map(function () { - return 0; - }, array_flip(range($min, $max))); + return array_map(fn() => 0, array_flip(range($min, $max))); } /** @@ -369,9 +367,7 @@ SQL; * @return array */ private function convertToTranslatedJson(array $data = []): array { - $translated = array_map(static function (string $a) { - return _t('gen.date.' . $a); - }, $data); + $translated = array_map(static fn(string $a) => _t('gen.date.' . $a), $data); return $translated; } -- cgit v1.2.3