diff --git a/src/Endpoints/Comments.php b/src/Endpoints/Comments.php index 22d1ca0..84acfd7 100644 --- a/src/Endpoints/Comments.php +++ b/src/Endpoints/Comments.php @@ -2,8 +2,6 @@ namespace FiveamCode\LaravelNotionApi\Endpoints; -use FiveamCode\LaravelNotionApi\Entities\Blocks\Block as BlockEntity; -use FiveamCode\LaravelNotionApi\Entities\Collections\BlockCollection; use FiveamCode\LaravelNotionApi\Entities\Collections\CommentCollection; use FiveamCode\LaravelNotionApi\Entities\Comment; use FiveamCode\LaravelNotionApi\Exceptions\HandlingException; @@ -52,7 +50,7 @@ public function __construct(Notion $notion) public function ofBlock(string $blockId): CommentCollection { $response = $this->get( - $this->url(Endpoint::COMMENTS . "?block_id={$blockId}&{$this->buildPaginationQuery()}") + $this->url(Endpoint::COMMENTS."?block_id={$blockId}&{$this->buildPaginationQuery()}") ); return new CommentCollection($response->json()); @@ -60,31 +58,31 @@ public function ofBlock(string $blockId): CommentCollection /** * @param string $discussionId - * * @return Comments */ public function onDiscussion(string $discussionId): self { - if($this->pageId !== null) { + if ($this->pageId !== null) { throw new HandlingException('You can only use ``->onDiscussion(...)`` or ``->onPage(...)``.'); } $this->discussionId = $discussionId; + return $this; } /** * @param string $pageId - * * @return Comments */ public function onPage(string $pageId): self { - if($this->discussionId !== null) { + if ($this->discussionId !== null) { throw new HandlingException('You can only use ``->onDiscussion(...)`` or ``->onPage(...)``.'); } $this->pageId = $pageId; + return $this; } diff --git a/src/Entities/Collections/CommentCollection.php b/src/Entities/Collections/CommentCollection.php index 3db076e..103c314 100644 --- a/src/Entities/Collections/CommentCollection.php +++ b/src/Entities/Collections/CommentCollection.php @@ -2,7 +2,6 @@ namespace FiveamCode\LaravelNotionApi\Entities\Collections; -use FiveamCode\LaravelNotionApi\Entities\Blocks\Block; use FiveamCode\LaravelNotionApi\Entities\Comment; use Illuminate\Support\Collection;