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, )