diff options
Diffstat (limited to 'app/Models/StatsDAOSQLite.php')
| -rw-r--r-- | app/Models/StatsDAOSQLite.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php index c45951069..4e51615fc 100644 --- a/app/Models/StatsDAOSQLite.php +++ b/app/Models/StatsDAOSQLite.php @@ -32,19 +32,12 @@ SQL; return []; } - switch ($period) { - case '%H': - $periodMax = 24; - break; - case '%w': - $periodMax = 7; - break; - case '%m': - $periodMax = 12; - break; - default: - $periodMax = 30; - } + $periodMax = match ($period) { + '%H' => 24, + '%w' => 7, + '%m' => 12, + default => 30, + }; $repartition = array_fill(0, $periodMax, 0); foreach ($res as $value) { |
