Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Feb 15, 2023
1 parent 2ce2554 commit 63a6a05
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 29 deletions.
2 changes: 0 additions & 2 deletions src/Events/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class Event

/**
* Event constructor.
*
* @param \Illuminate\Database\Eloquent\Model $like
*/
public function __construct(Model $like)
{
Expand Down
5 changes: 0 additions & 5 deletions src/Like.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions src/Traits/Likeable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand All @@ -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
{
Expand Down
12 changes: 0 additions & 12 deletions src/Traits/Liker.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

trait Liker
{
/**
* @param \Illuminate\Database\Eloquent\Model $object
* @return Like
*/
public function like(Model $object): Like
{
$attributes = [
Expand All @@ -43,9 +39,6 @@ function () use ($like, $attributes) {
}

/**
* @param \Illuminate\Database\Eloquent\Model $object
* @return bool
*
* @throws \Exception
*/
public function unlike(Model $object): bool
Expand All @@ -69,7 +62,6 @@ public function unlike(Model $object): bool
}

/**
* @param \Illuminate\Database\Eloquent\Model $object
* @return Like|null
*
* @throws \Exception
Expand All @@ -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())
Expand Down
4 changes: 0 additions & 4 deletions tests/FeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down

0 comments on commit 63a6a05

Please sign in to comment.