Skip to content

Commit 77098ac

Browse files
authored
Merge pull request #34 from 5am-code/feature/new-blocks
polish implementations
2 parents 27404c9 + d32de53 commit 77098ac

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Endpoints/Block.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace FiveamCode\LaravelNotionApi\Endpoints;
44

5-
use FiveamCode\LaravelNotionApi\Entities\Blocks\Block as BaseBlockEntity;
5+
use FiveamCode\LaravelNotionApi\Entities\Blocks\Block as BlockEntity;
66
use FiveamCode\LaravelNotionApi\Entities\Collections\BlockCollection;
77
use FiveamCode\LaravelNotionApi\Exceptions\HandlingException;
88
use FiveamCode\LaravelNotionApi\Exceptions\NotionException;
@@ -58,19 +58,19 @@ public function children(): BlockCollection
5858
* @return FiveamCode\LaravelNotionApi\Entities\Blocks\Block
5959
* @throws HandlingException
6060
*/
61-
public function append(array|BaseBlockEntity $appendices): BaseBlockEntity
61+
public function append(array|BlockEntity $appendices): BlockEntity
6262
{
6363
if (!is_array($appendices)) {
6464
$appendices = [$appendices];
6565
}
6666
$children = [];
6767

6868
foreach ($appendices as $block) {
69-
array_push($children, [
69+
$children[] = [
7070
"object" => "block",
7171
"type" => $block->getType(),
7272
$block->getType() => $block->getRawContent()
73-
]);
73+
];
7474
}
7575

7676
$body = [
@@ -82,6 +82,6 @@ public function append(array|BaseBlockEntity $appendices): BaseBlockEntity
8282
$body
8383
);
8484

85-
return new BaseBlockEntity($response->json());
85+
return new BlockEntity($response->json());
8686
}
8787
}

src/Entities/Blocks/BaseFileBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class BaseFileBlock extends Block implements Modifiable
1313
{
14-
protected static function createFileBlock(BaseFileBlock $fileBlock, string $url, string $caption = ""): BaseFileBlock
14+
protected static final function createFileBlock(BaseFileBlock $fileBlock, string $url, string $caption = ""): BaseFileBlock
1515
{
1616
$fileBlock->rawContent = [
1717
'type' => 'external',

src/Entities/Blocks/TextBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ protected static function createTextBlock(TextBlock $textBlock, array|string $te
1919

2020
$text = [];
2121
foreach ($textContent as $textItem) {
22-
array_push($text, [
22+
$text[] = [
2323
"type" => "text",
2424
"text" => [
2525
"content" => $textItem
2626
]
27-
]);
27+
];
2828
}
2929

3030
$textBlock->rawContent = [

0 commit comments

Comments
 (0)