From 63a6a0586e2141516406bd31bf35a9eaa7c6ec95 Mon Sep 17 00:00:00 2001 From: overtrue Date: Wed, 15 Feb 2023 11:18:25 +0800 Subject: [PATCH] wip --- src/Events/Event.php | 2 -- src/Like.php | 5 ----- src/Traits/Likeable.php | 6 ------ src/Traits/Liker.php | 12 ------------ tests/FeatureTest.php | 4 ---- 5 files changed, 29 deletions(-) diff --git a/src/Events/Event.php b/src/Events/Event.php index cc6105e..0e12136 100644 --- a/src/Events/Event.php +++ b/src/Events/Event.php @@ -13,8 +13,6 @@ class Event /** * Event constructor. - * - * @param \Illuminate\Database\Eloquent\Model $like */ public function __construct(Model $like) { diff --git a/src/Like.php b/src/Like.php index 9f480fd..0f8d94c 100644 --- a/src/Like.php +++ b/src/Like.php @@ -17,9 +17,6 @@ class Like extends Model 'deleted' => Unliked::class, ]; - /** - * @param array $attributes - */ public function __construct(array $attributes = []) { $this->table = \config('like.likes_table'); @@ -63,8 +60,6 @@ public function liker() } /** - * @param \Illuminate\Database\Eloquent\Builder $query - * @param string $type * @return \Illuminate\Database\Eloquent\Builder */ public function scopeWithType(Builder $query, string $type) diff --git a/src/Traits/Likeable.php b/src/Traits/Likeable.php index 3bf754c..280d12d 100644 --- a/src/Traits/Likeable.php +++ b/src/Traits/Likeable.php @@ -6,10 +6,6 @@ trait Likeable { - /** - * @param \Illuminate\Database\Eloquent\Model $user - * @return bool - */ public function isLikedBy(Model $user): bool { if (\is_a($user, config('auth.providers.users.model'))) { @@ -25,8 +21,6 @@ public function isLikedBy(Model $user): bool /** * Return followers. - * - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function likers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { diff --git a/src/Traits/Liker.php b/src/Traits/Liker.php index 46bb56b..3dd892a 100644 --- a/src/Traits/Liker.php +++ b/src/Traits/Liker.php @@ -13,10 +13,6 @@ trait Liker { - /** - * @param \Illuminate\Database\Eloquent\Model $object - * @return Like - */ public function like(Model $object): Like { $attributes = [ @@ -43,9 +39,6 @@ function () use ($like, $attributes) { } /** - * @param \Illuminate\Database\Eloquent\Model $object - * @return bool - * * @throws \Exception */ public function unlike(Model $object): bool @@ -69,7 +62,6 @@ public function unlike(Model $object): bool } /** - * @param \Illuminate\Database\Eloquent\Model $object * @return Like|null * * @throws \Exception @@ -79,10 +71,6 @@ public function toggleLike(Model $object) return $this->hasLiked($object) ? $this->unlike($object) : $this->like($object); } - /** - * @param \Illuminate\Database\Eloquent\Model $object - * @return bool - */ public function hasLiked(Model $object): bool { return ($this->relationLoaded('likes') ? $this->likes : $this->likes()) diff --git a/tests/FeatureTest.php b/tests/FeatureTest.php index fe76522..af817d0 100644 --- a/tests/FeatureTest.php +++ b/tests/FeatureTest.php @@ -233,10 +233,6 @@ public function test_liker_can_attach_like_status_to_votable_collection() $this->assertFalse($posts[2]['post']['has_liked']); } - /** - * @param \Closure $callback - * @return \Illuminate\Support\Collection - */ protected function getQueryLog(\Closure $callback): \Illuminate\Support\Collection { $sqls = \collect([]);