Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/Endpoints/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -52,39 +50,39 @@ 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());
}

/**
* @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;
}

Expand Down
1 change: 0 additions & 1 deletion src/Entities/Collections/CommentCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FiveamCode\LaravelNotionApi\Entities\Collections;

use FiveamCode\LaravelNotionApi\Entities\Blocks\Block;
use FiveamCode\LaravelNotionApi\Entities\Comment;
use Illuminate\Support\Collection;

Expand Down