From 28ca20f99fe37510a8a334c199afe4379e8e550f Mon Sep 17 00:00:00 2001 From: VeekeeFr <20480977+VeekeeFr@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:29:12 +0200 Subject: [PATCH] Applying @jbrooksuk implementation (see MR 3273) --- app/Http/Controllers/StatusPageController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Http/Controllers/StatusPageController.php b/app/Http/Controllers/StatusPageController.php index 81c0129d..87ced74b 100644 --- a/app/Http/Controllers/StatusPageController.php +++ b/app/Http/Controllers/StatusPageController.php @@ -74,11 +74,7 @@ class StatusPageController extends AbstractApiController ->values(); $numIncidentDays = count($allIncidentDays); - if ($appIncidentDays > 0) { - $numPages = round($numIncidentDays / $appIncidentDays); - } else { - $numPages = 1; - } + $numPages = round($numIncidentDays / max($appIncidentDays, 1)); $selectedDays = $allIncidentDays->slice($page * $appIncidentDays, $appIncidentDays)->all();