From 391849c27a1d4791efae930746a51d982820bd3a Mon Sep 17 00:00:00 2001 From: Leandro Gehlen Date: Fri, 27 Sep 2024 06:20:30 -0300 Subject: [PATCH] Using `Carbon\CarbonInterface` instead of `Illuminate\Support\Carbon` (#55) * Using `Carbon\CarbonInterface` instead of `Illuminate\Support\Carbon` * Discard `compose.json` --- src/Trend.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Trend.php b/src/Trend.php index 24c5cad..28ff762 100755 --- a/src/Trend.php +++ b/src/Trend.php @@ -2,22 +2,22 @@ namespace Flowframe\Trend; +use Carbon\CarbonInterface; use Carbon\CarbonPeriod; use Error; use Flowframe\Trend\Adapters\MySqlAdapter; use Flowframe\Trend\Adapters\PgsqlAdapter; use Flowframe\Trend\Adapters\SqliteAdapter; use Illuminate\Database\Eloquent\Builder; -use Illuminate\Support\Carbon; use Illuminate\Support\Collection; class Trend { public string $interval; - public Carbon $start; + public CarbonInterface $start; - public Carbon $end; + public CarbonInterface $end; public string $dateColumn = 'created_at'; @@ -145,7 +145,7 @@ public function mapValuesToDates(Collection $values): Collection )); $placeholders = $this->getDatePeriod()->map( - fn (Carbon $date) => new TrendValue( + fn (CarbonInterface $date) => new TrendValue( date: $date->format($this->getCarbonDateFormat()), aggregate: 0, )