From 14a79447f5502a9ef67897b444583b24edd817f4 Mon Sep 17 00:00:00 2001 From: Alex Renoki Date: Fri, 18 Sep 2020 12:44:07 +0300 Subject: [PATCH] Added $processCollection to the getForGraph method --- src/Contracts/StatisticsStore.php | 3 ++- src/Statistics/Stores/DatabaseStore.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Contracts/StatisticsStore.php b/src/Contracts/StatisticsStore.php index a5f6002..dc29a14 100644 --- a/src/Contracts/StatisticsStore.php +++ b/src/Contracts/StatisticsStore.php @@ -48,7 +48,8 @@ interface StatisticsStore * format that is easily to read for graphs. * * @param callable $processQuery + * @param callable $processCollection * @return array */ - public function getForGraph(callable $processQuery = null): array; + public function getForGraph(callable $processQuery = null, callable $processCollection = null): array; } diff --git a/src/Statistics/Stores/DatabaseStore.php b/src/Statistics/Stores/DatabaseStore.php index 2a36529..042e72b 100644 --- a/src/Statistics/Stores/DatabaseStore.php +++ b/src/Statistics/Stores/DatabaseStore.php @@ -86,12 +86,13 @@ class DatabaseStore implements StatisticsStore * format that is easily to read for graphs. * * @param callable $processQuery + * @param callable $processCollection * @return array */ - public function getForGraph(callable $processQuery = null): array + public function getForGraph(callable $processQuery = null, callable $processCollection = null): array { $statistics = collect( - $this->getRecords($processQuery) + $this->getRecords($processQuery, $processCollection) ); return $this->statisticsToGraph($statistics);