We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d59d245 commit 8d3f456Copy full SHA for 8d3f456
backend/app/Entity/Tweet.php
@@ -80,7 +80,8 @@ public function getAuthor(): User
80
81
public function getCommentsCount(): int
82
{
83
- return $this->comments_count;
+ // cast to int, because if tweet doesn't have comments null will be returned
84
+ return (int)$this->comments_count;
85
}
86
87
public function changeContent(string $text): void
0 commit comments