Skip to content

Commit c133005

Browse files
alexgarrettsmithactions-user
authored andcommitted
Fix styling
1 parent 897bbbe commit c133005

6 files changed

+9
-11
lines changed

src/LaravelPopularityServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Spatie\LaravelPackageTools\Package;
66
use Spatie\LaravelPackageTools\PackageServiceProvider;
7-
use Codecourse\LaravelPopularity\Commands\LaravelPopularityCommand;
87

98
class LaravelPopularityServiceProvider extends PackageServiceProvider
109
{

src/Models/Visit.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
namespace Codecourse\LaravelPopularity\Models;
44

5-
use Illuminate\Database\Eloquent\Factories\HasFactory;
65
use Illuminate\Database\Eloquent\Model;
76

87
class Visit extends Model
98
{
109
protected $fillable = [
11-
'data'
10+
'data',
1211
];
1312

1413
protected $casts = [
15-
'data' => 'json'
14+
'data' => 'json',
1615
];
1716

1817
public function visitable()

src/PendingVisit.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ protected function buildJsonColumns()
5353

5454
protected function shouldBeLoggedAgain(Visit $visit)
5555
{
56-
return !$visit->wasRecentlyCreated && $visit->created_at->lt($this->interval);
56+
return ! $visit->wasRecentlyCreated && $visit->created_at->lt($this->interval);
5757
}
5858

5959
public function __destruct()
6060
{
6161
$visit = $this->model->visits()->latest()->firstOrCreate($this->buildJsonColumns(), [
62-
'data' => $this->attributes
62+
'data' => $this->attributes,
6363
]);
6464

6565
$visit->when($this->shouldBeLoggedAgain($visit), function () use ($visit) {

src/Traits/FiltersByPopularityTimeframe.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function scopePopularBetween(Builder $query, Carbon $from, Carbon $to)
6060
{
6161
$query->whereHas('visits', $this->betweenScope($from, $to))
6262
->withCount([
63-
'visits as visit_count' => $this->betweenScope($from, $to)
63+
'visits as visit_count' => $this->betweenScope($from, $to),
6464
]);
6565
}
6666

tests/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Codecourse\LaravelPopularity\Tests;
44

5+
use Codecourse\LaravelPopularity\LaravelPopularityServiceProvider;
56
use Illuminate\Database\Eloquent\Factories\Factory;
67
use Orchestra\Testbench\TestCase as Orchestra;
7-
use Codecourse\LaravelPopularity\LaravelPopularityServiceProvider;
88

99
class TestCase extends Orchestra
1010
{

tests/VisitTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
$article = Article::factory()->create();
3333

3434
$article->visit()->withData([
35-
'cats' => true
35+
'cats' => true,
3636
]);
3737

3838
expect($article->visits->first()->data)->toMatchArray(['cats' => true]);
@@ -59,11 +59,11 @@
5959
$article = Article::factory()->create();
6060

6161
$article->visit()->withData([
62-
'cats' => true
62+
'cats' => true,
6363
]);
6464

6565
$article->visit()->withData([
66-
'cats' => true
66+
'cats' => true,
6767
]);
6868

6969
expect($article->visits->count())->toBe(1);

0 commit comments

Comments
 (0)