Skip to content

Commit 24eaada

Browse files
committed
add larastan hints
1 parent 8dc9fba commit 24eaada

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Models/Activity.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public function __construct(array $attributes = [])
5959
parent::__construct($attributes);
6060
}
6161

62+
/**
63+
* @return MorphTo<Model, $this>
64+
*/
6265
public function subject(): MorphTo
6366
{
6467
if (config('activitylog.subject_returns_soft_deleted_models')) {
@@ -68,6 +71,9 @@ public function subject(): MorphTo
6871
return $this->morphTo();
6972
}
7073

74+
/**
75+
* @return MorphTo<Model, $this>
76+
*/
7177
public function causer(): MorphTo
7278
{
7379
return $this->morphTo();

src/Traits/CausesActivity.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
use Illuminate\Database\Eloquent\Relations\MorphMany;
66
use Spatie\Activitylog\ActivitylogServiceProvider;
7+
use Spatie\Activitylog\Models\Activity;
8+
79

810
trait CausesActivity
911
{
12+
/** @return MorphMany<Activity, $this> */
1013
public function actions(): MorphMany
1114
{
1215
return $this->morphMany(

0 commit comments

Comments
 (0)