diff options
| author | 2024-06-05 22:04:06 +0200 | |
|---|---|---|
| committer | 2024-06-05 22:04:06 +0200 | |
| commit | f99c8d5f54c67e0abc3f3189b4f5e3e4571e114c (patch) | |
| tree | d7d74a628cd9614dd4093220139b6c073f3a5c54 /app/Models/StatsDAO.php | |
| parent | 8fc8ac3aefca73a4cd509313a2f1ad73ef7f2e1a (diff) | |
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 <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/StatsDAO.php')
| -rw-r--r-- | app/Models/StatsDAO.php | 10 |
1 files changed, 3 insertions, 7 deletions
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<int,int> */ 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<string> */ 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; } |
