forked from eatvio/eatvio-infra
make static analyse code diets
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
@@ -39,12 +40,12 @@ class DietComment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function author()
|
||||
public function author(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function diet()
|
||||
public function diet(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Diet::class, 'diet_id');
|
||||
}
|
||||
@@ -54,7 +55,7 @@ class DietComment extends Model
|
||||
return $this->hasMany(DietCommentUpvote::class, 'comment_id');
|
||||
}
|
||||
|
||||
public function isUpVoted(): bool
|
||||
public function isUpVoted(): bool|int
|
||||
{
|
||||
if (auth()->user()) {
|
||||
return auth()
|
||||
@@ -67,7 +68,7 @@ class DietComment extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isDownVoted(): bool
|
||||
public function isDownVoted(): bool|int
|
||||
{
|
||||
if (auth()->user()) {
|
||||
return auth()
|
||||
@@ -80,7 +81,7 @@ class DietComment extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
public function removeUpVote(): bool
|
||||
public function removeUpVote(): bool|int
|
||||
{
|
||||
if (auth()->user()) {
|
||||
return auth()
|
||||
|
||||
Reference in New Issue
Block a user