Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Carbon\CarbonInterface instead of Illuminate\Support\Carbon #55

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this has nothing to do with the subject of this PR.

Copy link
Contributor Author

@leandrogehlen leandrogehlen Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already reverted the composer

}
},
"extra": {
"laravel": {
Expand Down
8 changes: 4 additions & 4 deletions src/Trend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
)
Expand Down