Skip to content

Commit 5166157

Browse files
committed
rename Comment::create(...)
- to ``::fromText(...)``
1 parent dd4e289 commit 5166157

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Entities/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(?array $rawResponse = null)
3232
}
3333
}
3434

35-
public static function create($content): Comment
35+
public static function fromText($content): Comment
3636
{
3737
$commentEntity = new Comment();
3838

tests/EndpointCommentsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
$this->expectExceptionMessage('Insufficient permissions for this endpoint.');
9393
$this->expectExceptionCode(403);
9494

95-
\Notion::comments()->onPage('5c6a2821-6bb1-4a7e-b6e1-c50111515c3d')->create(Comment::create('Hello world'));
95+
\Notion::comments()->onPage('5c6a2821-6bb1-4a7e-b6e1-c50111515c3d')->create(Comment::fromText('Hello world'));
9696
});
9797

9898
it('should throw correct exception if discussion is not found with discussion_id when creating a comment', function () {
@@ -109,7 +109,7 @@
109109
$this->expectExceptionMessage('Could not find discussion with ID: 141216d8-bbc5-4c24-9d37-3c45d3bc15cc.');
110110
$this->expectExceptionCode(404);
111111

112-
\Notion::comments()->onDiscussion('141216d8-bbc5-4c24-9d37-3c45d3bc15cc')->create(Comment::create('Hello world'));
112+
\Notion::comments()->onDiscussion('141216d8-bbc5-4c24-9d37-3c45d3bc15cc')->create(Comment::fromText('Hello world'));
113113
});
114114

115115
it('successfully creates a comment within a page', function () {
@@ -123,7 +123,7 @@
123123
),
124124
]);
125125

126-
$comment = \Notion::comments()->onPage('5c6a2821-6bb1-4a7e-b6e1-c50111515c3d')->create(Comment::create('Hello world'));
126+
$comment = \Notion::comments()->onPage('5c6a2821-6bb1-4a7e-b6e1-c50111515c3d')->create(Comment::fromText('Hello world'));
127127

128128
expect($comment)->toBeInstanceOf(Comment::class);
129129
expect($comment->getObjectType())->toBe('comment');

0 commit comments

Comments
 (0)