forked from eatvio/eatvio-infra
refactoring static analyse code
This commit is contained in:
@@ -5,6 +5,8 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* App\Models\PlanComment
|
||||
@@ -40,12 +42,12 @@ class PlanComment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function plan()
|
||||
public function plan(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plan::class, 'plan_id');
|
||||
}
|
||||
@@ -55,7 +57,7 @@ class PlanComment extends Model
|
||||
return $this->hasMany(CommentUpvote::class, 'comment_id');
|
||||
}
|
||||
|
||||
public function isUpVoted(): bool
|
||||
public function isUpVoted(): bool|int
|
||||
{
|
||||
if (auth()->user()) {
|
||||
return auth()
|
||||
@@ -68,7 +70,7 @@ class PlanComment extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isDownVoted(): bool
|
||||
public function isDownVoted(): bool|int
|
||||
{
|
||||
if (auth()->user()) {
|
||||
return auth()
|
||||
|
||||
Reference in New Issue
Block a user