forked from eatvio/eatvio-infra
refactoring static analyse code
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
/**
|
||||
* App\Models\RecipeCommentUpvote
|
||||
@@ -42,22 +44,22 @@ class RecipeCommentUpvote extends Model
|
||||
'type',
|
||||
];
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function recipe_comment()
|
||||
public function recipe_comment(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BlogPostComment::class, 'recipe_comment_id');
|
||||
}
|
||||
|
||||
public function scopeForRecipeCommentsUpVote($query, RecipeComment $comment)
|
||||
public function scopeForRecipeCommentsUpVote(Builder $query, RecipeComment $comment): Builder
|
||||
{
|
||||
return $query->where('recipe_comment_id', $comment->id)->where('type', 'upvote');
|
||||
}
|
||||
|
||||
public function scopeForRecipeCommentsDownVote($query, RecipeComment $comment)
|
||||
public function scopeForRecipeCommentsDownVote(Builder $query, RecipeComment $comment): Builder
|
||||
{
|
||||
return $query->where('recipe_comment_id', $comment->id)->where('type', 'downvote');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user