forked from eatvio/eatvio-infra
make static analyz for blogPost
This commit is contained in:
@@ -4,17 +4,18 @@ namespace App\Livewire\BlogPost\Comment;
|
||||
|
||||
use App\Models\BlogPostComment;
|
||||
use Livewire\Component;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class Upvote extends Component
|
||||
{
|
||||
public BlogPostComment $comment;
|
||||
|
||||
public function mount(BlogPostComment $comment)
|
||||
public function mount(BlogPostComment $comment): void
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
|
||||
public function render()
|
||||
public function render(): View
|
||||
{
|
||||
$upvotes = $this->comment->upvotes()->forBlogPostCommentsUpVote($this->comment)->count();
|
||||
$downvotes = $this->comment->upvotes()->forBlogPostCommentsDownVote($this->comment)->count();
|
||||
@@ -30,7 +31,7 @@ class Upvote extends Component
|
||||
);
|
||||
}
|
||||
|
||||
public function upvote()
|
||||
public function upvote(): void
|
||||
{
|
||||
if ($this->comment->isUpVoted()) {
|
||||
$this->comment->removeUpVote();
|
||||
@@ -49,7 +50,7 @@ class Upvote extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
public function downvote()
|
||||
public function downvote(): void
|
||||
{
|
||||
if ($this->comment->isDownVoted()) {
|
||||
$this->comment->removeDownVote();
|
||||
|
||||
Reference in New Issue
Block a user