From edf1c89c49a7cbc5617c0c4ea4d8148036c26004 Mon Sep 17 00:00:00 2001 From: Leandro Guindani Gehlen Date: Thu, 7 Mar 2024 14:21:09 -0300 Subject: [PATCH 1/2] Using `Carbon\CarbonInterface` instead of `Illuminate\Support\Carbon` --- composer.json | 5 ++++- src/Trend.php | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 5dfc53d..1a8466e 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,10 @@ "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "pestphp/pest-plugin": true + } }, "extra": { "laravel": { diff --git a/src/Trend.php b/src/Trend.php index eeb414b..b483f58 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'; @@ -140,7 +140,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, ) From 9d086da108b56a26b03538c0fe11ac516955b87e Mon Sep 17 00:00:00 2001 From: Leandro Guindani Gehlen Date: Fri, 29 Mar 2024 07:08:15 -0300 Subject: [PATCH 2/2] Discard `compose.json` --- composer.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 1a8466e..5dfc53d 100644 --- a/composer.json +++ b/composer.json @@ -44,10 +44,7 @@ "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, "config": { - "sort-packages": true, - "allow-plugins": { - "pestphp/pest-plugin": true - } + "sort-packages": true }, "extra": { "laravel": {