From 802339b6fcce78e9442f73dd945ccee4cceb30d8 Mon Sep 17 00:00:00 2001 From: eliseekn Date: Fri, 19 Apr 2024 08:14:50 +0000 Subject: [PATCH] Fix metrics return type --- .idea/blade.xml | 2 +- src/LaravelMetrics.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/blade.xml b/.idea/blade.xml index 6de0825..37ac598 100644 --- a/.idea/blade.xml +++ b/.idea/blade.xml @@ -107,7 +107,7 @@ - + diff --git a/src/LaravelMetrics.php b/src/LaravelMetrics.php index 9f37f1d..977724e 100644 --- a/src/LaravelMetrics.php +++ b/src/LaravelMetrics.php @@ -457,7 +457,7 @@ protected function withVariations(int $count = 1): int $laravelMetrics = (new self(DB::table($this->table))) ->by($this->period, $count) - ->aggregate($this->aggregate, str_replace($this->table . '.', '', $this->column)); + ->aggregate($this->aggregate, str_replace($this->table.'.', '', $this->column)); $result = match ($this->period) { Period::DAY->value => $laravelMetrics @@ -685,7 +685,7 @@ protected function populateMissingData(array $labels, array $data): array /** * Generate metrics data */ - public function metrics(int $withVariationsCount = null): int|array + public function metrics(int $withVariationsCount = null): mixed { $metricsData = $this->metricsData(); $count = is_null($metricsData) ? 0 : ($metricsData->data ?? 0);