From 315bfebbe974d993145b060c334e14151ceac864 Mon Sep 17 00:00:00 2001 From: maestroerror Date: Fri, 3 Oct 2025 17:09:31 +0400 Subject: [PATCH 1/6] Updated vendor name --- LICENSE.md | 2 +- README.md | 18 ++++---- column-list-fetch-example.php | 4 +- composer.json | 10 ++--- config/md-notion.php | 42 +++++++++---------- examples/mdnotion-facade-full-example.php | 6 +-- examples/mdnotion-facade-read-example.php | 6 +-- examples/page-reader-example.php | 12 +++--- examples/sdk-example.php | 2 +- examples/table-fetch-example.php | 4 +- examples/toggle-fetch-example.php | 4 +- index.php | 2 +- mdnotion_prd.md | 2 +- phpunit.xml.dist | 2 +- src/Adapters/BaseBlockAdapter.php | 6 +-- src/Adapters/BlockAdapterFactory.php | 4 +- src/Adapters/BlockAdapterInterface.php | 2 +- src/Adapters/BookmarkAdapter.php | 4 +- src/Adapters/BulletedListItemAdapter.php | 4 +- src/Adapters/CalloutAdapter.php | 4 +- src/Adapters/CodeAdapter.php | 4 +- src/Adapters/ColumnAdapter.php | 8 ++-- src/Adapters/ColumnListAdapter.php | 4 +- src/Adapters/DividerAdapter.php | 4 +- src/Adapters/FileAdapter.php | 4 +- src/Adapters/HeadingAdapter.php | 4 +- src/Adapters/ImageAdapter.php | 4 +- src/Adapters/NumberedListItemAdapter.php | 4 +- src/Adapters/ParagraphAdapter.php | 4 +- src/Adapters/QuoteAdapter.php | 4 +- src/Adapters/TableAdapter.php | 4 +- src/Adapters/TableRowAdapter.php | 6 +-- src/Adapters/TodoAdapter.php | 4 +- src/Adapters/ToggleAdapter.php | 6 +-- src/Adapters/VideoAdapter.php | 4 +- src/Commands/MdNotionCommand.php | 2 +- src/ContentBuilder.php | 8 ++-- src/DTOs/BlockDTO.php | 2 +- src/DTOs/BookmarkDTO.php | 2 +- src/DTOs/BulletedListItemDTO.php | 2 +- src/DTOs/CalloutDTO.php | 2 +- src/DTOs/CodeDTO.php | 2 +- src/DTOs/ColumnDTO.php | 2 +- src/DTOs/ColumnListDTO.php | 2 +- src/DTOs/DividerDTO.php | 2 +- src/DTOs/FileDTO.php | 2 +- src/DTOs/HeadingDTO.php | 2 +- src/DTOs/ImageDTO.php | 2 +- src/DTOs/NumberedListItemDTO.php | 2 +- src/DTOs/ParagraphDTO.php | 2 +- src/DTOs/QuoteDTO.php | 2 +- src/DTOs/RichTextDTO.php | 2 +- src/DTOs/TableDTO.php | 2 +- src/DTOs/TableRowDTO.php | 2 +- src/DTOs/TodoDTO.php | 2 +- src/DTOs/ToggleDTO.php | 2 +- src/DTOs/VideoDTO.php | 2 +- src/Facades/MdNotion.php | 6 +-- src/MdNotion.php | 8 ++-- src/MdNotionServiceProvider.php | 14 +++---- src/Objects/BaseObject.php | 12 +++--- src/Objects/Database.php | 6 +-- src/Objects/Page.php | 8 ++-- src/SDK/Notion.php | 4 +- src/SDK/Requests/Actions/AddCommentToPage.php | 2 +- src/SDK/Requests/Actions/BlockChildren.php | 2 +- src/SDK/Requests/Actions/Database.php | 2 +- src/SDK/Requests/Actions/ListComments.php | 2 +- src/SDK/Requests/Actions/Page.php | 2 +- src/SDK/Requests/Actions/QueryDataSource.php | 2 +- src/SDK/Resource.php | 2 +- src/SDK/Resource/Actions.php | 18 ++++---- src/Services/BlockRegistry.php | 6 +-- src/Services/DatabaseReader.php | 8 ++-- src/Services/DatabaseTable.php | 2 +- src/Services/PageReader.php | 8 ++-- src/Traits/HasChildPages.php | 4 +- src/Traits/HasIcon.php | 2 +- src/Traits/HasMeta.php | 2 +- src/Traits/HasParent.php | 2 +- src/Traits/HasTitle.php | 4 +- tests/Adapters/BookmarkAdapterTest.php | 2 +- .../Adapters/BulletedListItemAdapterTest.php | 2 +- tests/Adapters/CalloutAdapterTest.php | 2 +- tests/Adapters/CodeAdapterTest.php | 2 +- tests/Adapters/ColumnAdapterTest.php | 6 +-- tests/Adapters/ColumnListAdapterTest.php | 6 +-- tests/Adapters/DividerAdapterTest.php | 2 +- tests/Adapters/FileAdapterTest.php | 2 +- tests/Adapters/HeadingAdapterTest.php | 2 +- tests/Adapters/ImageAdapterTest.php | 2 +- .../Adapters/NumberedListItemAdapterTest.php | 2 +- tests/Adapters/ParagraphAdapterTest.php | 2 +- tests/Adapters/QuoteAdapterTest.php | 2 +- tests/Adapters/TableAdapterTest.php | 4 +- tests/Adapters/TableRowAdapterTest.php | 2 +- tests/Adapters/TodoAdapterTest.php | 2 +- tests/Adapters/ToggleAdapterTest.php | 8 ++-- tests/Adapters/VideoAdapterTest.php | 2 +- tests/ContentBuilderTest.php | 8 ++-- tests/FacadeTest.php | 8 ++-- tests/MdNotionTest.php | 10 ++--- tests/Objects/ContextTest.php | 4 +- tests/Objects/DatabaseFetchTest.php | 4 +- tests/Objects/IconTest.php | 4 +- tests/Objects/PageFetchTest.php | 4 +- tests/Objects/RenderTitleTest.php | 4 +- tests/Objects/TitleTest.php | 4 +- tests/Pest.php | 2 +- .../Requests/AddCommentToPageRequestTest.php | 4 +- .../SDK/Requests/BlockChildrenRequestTest.php | 4 +- tests/SDK/Requests/DatabaseRequestTest.php | 4 +- .../SDK/Requests/ListCommentsRequestTest.php | 4 +- tests/SDK/Requests/PageRequestTest.php | 4 +- .../Requests/QueryDataSourceRequestTest.php | 4 +- tests/Services/BlockRegistryTest.php | 14 +++---- tests/Services/DatabaseReaderTest.php | 8 ++-- tests/Services/DatabaseTableBasicTest.php | 4 +- tests/Services/IntegrationTest.php | 8 ++-- tests/Services/PageReaderTest.php | 10 ++--- tests/TestCase.php | 6 +-- 121 files changed, 282 insertions(+), 282 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 5fd3fbd..48c41cd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) RedberryProducts +Copyright (c) Redberry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6b92533..f0a3390 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Read your notion pages as Markdown in Laravel applications Example: ```php -use RedberryProducts\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; @@ -77,8 +77,8 @@ return [ * Customize these to use your own adapters. */ 'adapters' => [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, // ... many more block adapters ], ]; @@ -123,7 +123,7 @@ To get your Notion API key: Get the content of a single page as markdown: ```php -use RedberryProducts\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; $content = MdNotion::make($pageId)->content()->read(); @@ -230,7 +230,7 @@ The `MdNotion` package provides rich object models for working with Notion pages #### Basic Properties and Methods ```php -use RedberryProducts\MdNotion\Objects\Page; +use Redberry\MdNotion\Objects\Page; // Create from data $page = Page::from([ @@ -279,7 +279,7 @@ $updatedPage = $originalPage->fetch(); #### Basic Properties and Methods ```php -use RedberryProducts\MdNotion\Objects\Database; +use Redberry\MdNotion\Objects\Database; // Create from data $database = Database::from([ @@ -507,7 +507,7 @@ You will need adapter class extending `src\Adapters\BaseBlockAdapter.php` and cu namespace App\Adapters; -use RedberryProducts\MdNotion\Adapters\BaseBlockAdapter; +use Redberry\MdNotion\Adapters\BaseBlockAdapter; class CustomCodeAdapter extends BaseBlockAdapter { @@ -550,8 +550,8 @@ return [ 'adapters' => [ 'callout' => \App\Adapters\CustomCalloutAdapter::class, // Keep existing adapters... - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, // ... other adapters ], ]; diff --git a/column-list-fetch-example.php b/column-list-fetch-example.php index 138a425..ec5b39a 100644 --- a/column-list-fetch-example.php +++ b/column-list-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\ColumnListAdapter; +use Redberry\MdNotion\Adapters\ColumnListAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Use actual block ID from Notion $columnListBlock = [ diff --git a/composer.json b/composer.json index faa0ec0..8900425 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "redberry/md-notion", "description": "Read your notion pages as Markdown in Laravel applications.", "keywords": [ - "RedberryProducts", + "Redberry", "laravel", "md-notion" ], @@ -31,12 +31,12 @@ }, "autoload": { "psr-4": { - "RedberryProducts\\MdNotion\\": "src/" + "Redberry\\MdNotion\\": "src/" } }, "autoload-dev": { "psr-4": { - "RedberryProducts\\MdNotion\\Tests\\": "tests/", + "Redberry\\MdNotion\\Tests\\": "tests/", "Workbench\\App\\": "workbench/app/" } }, @@ -57,10 +57,10 @@ "extra": { "laravel": { "providers": [ - "RedberryProducts\\MdNotion\\MdNotionServiceProvider" + "Redberry\\MdNotion\\MdNotionServiceProvider" ], "aliases": { - "MdNotion": "RedberryProducts\\MdNotion\\Facades\\MdNotion" + "MdNotion": "Redberry\\MdNotion\\Facades\\MdNotion" } } }, diff --git a/config/md-notion.php b/config/md-notion.php index be7b9cf..d55e9f4 100644 --- a/config/md-notion.php +++ b/config/md-notion.php @@ -1,6 +1,6 @@ [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'heading_2' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'heading_3' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, - 'bulleted_list_item' => \RedberryProducts\MdNotion\Adapters\BulletedListItemAdapter::class, - 'numbered_list_item' => \RedberryProducts\MdNotion\Adapters\NumberedListItemAdapter::class, - 'to_do' => \RedberryProducts\MdNotion\Adapters\ToDoAdapter::class, - 'toggle' => \RedberryProducts\MdNotion\Adapters\ToggleAdapter::class, - 'code' => \RedberryProducts\MdNotion\Adapters\CodeAdapter::class, - 'quote' => \RedberryProducts\MdNotion\Adapters\QuoteAdapter::class, - 'callout' => \RedberryProducts\MdNotion\Adapters\CalloutAdapter::class, - 'divider' => \RedberryProducts\MdNotion\Adapters\DividerAdapter::class, - 'bookmark' => \RedberryProducts\MdNotion\Adapters\BookmarkAdapter::class, - 'image' => \RedberryProducts\MdNotion\Adapters\ImageAdapter::class, - 'file' => \RedberryProducts\MdNotion\Adapters\FileAdapter::class, - 'video' => \RedberryProducts\MdNotion\Adapters\VideoAdapter::class, - 'column_list' => \RedberryProducts\MdNotion\Adapters\ColumnListAdapter::class, - 'column' => \RedberryProducts\MdNotion\Adapters\ColumnAdapter::class, - 'table' => \RedberryProducts\MdNotion\Adapters\TableAdapter::class, - 'table_row' => \RedberryProducts\MdNotion\Adapters\TableRowAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'heading_2' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'heading_3' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, + 'bulleted_list_item' => \Redberry\MdNotion\Adapters\BulletedListItemAdapter::class, + 'numbered_list_item' => \Redberry\MdNotion\Adapters\NumberedListItemAdapter::class, + 'to_do' => \Redberry\MdNotion\Adapters\ToDoAdapter::class, + 'toggle' => \Redberry\MdNotion\Adapters\ToggleAdapter::class, + 'code' => \Redberry\MdNotion\Adapters\CodeAdapter::class, + 'quote' => \Redberry\MdNotion\Adapters\QuoteAdapter::class, + 'callout' => \Redberry\MdNotion\Adapters\CalloutAdapter::class, + 'divider' => \Redberry\MdNotion\Adapters\DividerAdapter::class, + 'bookmark' => \Redberry\MdNotion\Adapters\BookmarkAdapter::class, + 'image' => \Redberry\MdNotion\Adapters\ImageAdapter::class, + 'file' => \Redberry\MdNotion\Adapters\FileAdapter::class, + 'video' => \Redberry\MdNotion\Adapters\VideoAdapter::class, + 'column_list' => \Redberry\MdNotion\Adapters\ColumnListAdapter::class, + 'column' => \Redberry\MdNotion\Adapters\ColumnAdapter::class, + 'table' => \Redberry\MdNotion\Adapters\TableAdapter::class, + 'table_row' => \Redberry\MdNotion\Adapters\TableRowAdapter::class, ], ]; diff --git a/examples/mdnotion-facade-full-example.php b/examples/mdnotion-facade-full-example.php index 2687657..4e33e39 100644 --- a/examples/mdnotion-facade-full-example.php +++ b/examples/mdnotion-facade-full-example.php @@ -23,9 +23,9 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Facades\MdNotion; -use RedberryProducts\MdNotion\MdNotionServiceProvider; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\MdNotionServiceProvider; +use Redberry\MdNotion\SDK\Notion; // Set up Laravel container $container = new Container; diff --git a/examples/mdnotion-facade-read-example.php b/examples/mdnotion-facade-read-example.php index 3a3d1cc..3d515c6 100644 --- a/examples/mdnotion-facade-read-example.php +++ b/examples/mdnotion-facade-read-example.php @@ -23,9 +23,9 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Facades\MdNotion; -use RedberryProducts\MdNotion\MdNotionServiceProvider; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\Facades\MdNotion; +use Redberry\MdNotion\MdNotionServiceProvider; +use Redberry\MdNotion\SDK\Notion; // Set up Laravel container $container = new Container; diff --git a/examples/page-reader-example.php b/examples/page-reader-example.php index e83fcf7..1a8917b 100644 --- a/examples/page-reader-example.php +++ b/examples/page-reader-example.php @@ -12,12 +12,12 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\BlockAdapterFactory; -use RedberryProducts\MdNotion\SDK\Notion; -use RedberryProducts\MdNotion\Services\BlockRegistry; -use RedberryProducts\MdNotion\Services\DatabaseReader; -use RedberryProducts\MdNotion\Services\DatabaseTable; -use RedberryProducts\MdNotion\Services\PageReader; +use Redberry\MdNotion\Adapters\BlockAdapterFactory; +use Redberry\MdNotion\SDK\Notion; +use Redberry\MdNotion\Services\BlockRegistry; +use Redberry\MdNotion\Services\DatabaseReader; +use Redberry\MdNotion\Services\DatabaseTable; +use Redberry\MdNotion\Services\PageReader; // Set up Laravel container $container = new Container; diff --git a/examples/sdk-example.php b/examples/sdk-example.php index fe4b686..ac9aa90 100644 --- a/examples/sdk-example.php +++ b/examples/sdk-example.php @@ -2,7 +2,7 @@ require_once __DIR__.'/../vendor/autoload.php'; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; $token = include __DIR__.'/../notion-token.php'; $notion = new Notion($token, '2025-09-03'); diff --git a/examples/table-fetch-example.php b/examples/table-fetch-example.php index 596a69d..bf4ef31 100644 --- a/examples/table-fetch-example.php +++ b/examples/table-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\TableAdapter; +use Redberry\MdNotion\Adapters\TableAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Load table JSON $tableJson = file_get_contents(__DIR__.'/../BlockJsonExamples/TableJson.json'); diff --git a/examples/toggle-fetch-example.php b/examples/toggle-fetch-example.php index 13842a3..1dc32c7 100644 --- a/examples/toggle-fetch-example.php +++ b/examples/toggle-fetch-example.php @@ -12,7 +12,7 @@ use Illuminate\View\Engines\EngineResolver; use Illuminate\View\Factory; use Illuminate\View\FileViewFinder; -use RedberryProducts\MdNotion\Adapters\ToggleAdapter; +use Redberry\MdNotion\Adapters\ToggleAdapter; // Set up Laravel container $container = new Container; @@ -56,7 +56,7 @@ // Bind view factory to container $container->instance('view', $factory); View::setFacadeApplication($container); -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; // Load toggle JSON $toggleJson = file_get_contents(__DIR__.'/../BlockJsonExamples/ToggleJson.json'); diff --git a/index.php b/index.php index ab2d3f3..fdafcca 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require_once __DIR__.'/vendor/autoload.php'; -use RedberryProducts\MdNotion\SDK\Notion; +use Redberry\MdNotion\SDK\Notion; $token = include __DIR__.'/notion-token.php'; $notion = new Notion($token, '2025-09-03'); diff --git a/mdnotion_prd.md b/mdnotion_prd.md index a6b3f9b..2e39e5f 100644 --- a/mdnotion_prd.md +++ b/mdnotion_prd.md @@ -25,7 +25,7 @@ The mission of MdNotion is to provide Laravel developers with an easy, reliable, ## Usage goal ```php -use RedberryProducts\Facades\MdNotion; +use Redberry\Facades\MdNotion; $pageId = '263d9316605a806f9e95e1377a46ff3e'; $MdNotion = MdNotion::make($pageId); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d39c995..48d0829 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ backupStaticProperties="false" > - + tests diff --git a/src/Adapters/BaseBlockAdapter.php b/src/Adapters/BaseBlockAdapter.php index 3d09774..697c620 100644 --- a/src/Adapters/BaseBlockAdapter.php +++ b/src/Adapters/BaseBlockAdapter.php @@ -1,9 +1,9 @@ setSdk($this->sdk); $contents[] = trim($adapter->toMarkdown($childBlock)); diff --git a/src/Adapters/ColumnListAdapter.php b/src/Adapters/ColumnListAdapter.php index 9c8c213..4150194 100644 --- a/src/Adapters/ColumnListAdapter.php +++ b/src/Adapters/ColumnListAdapter.php @@ -1,8 +1,8 @@ hasChildPages()) { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $this->setChildPages( $this->getChildPages()->map(function (Page $page) use ($pageReader) { return $pageReader->read($page->getId()); @@ -77,7 +77,7 @@ public function hasTableContent(): bool */ public function fetch(): static { - $databaseReader = app(\RedberryProducts\MdNotion\Services\DatabaseReader::class); + $databaseReader = app(\Redberry\MdNotion\Services\DatabaseReader::class); $fetchedDatabase = $databaseReader->read($this->getId()); // Copy all data from the fetched database to this instance diff --git a/src/Objects/Page.php b/src/Objects/Page.php index 3372a3a..c1fbe57 100644 --- a/src/Objects/Page.php +++ b/src/Objects/Page.php @@ -1,6 +1,6 @@ hasChildPages()) { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $this->setChildPages( $this->getChildPages()->map(function (Page $page) use ($pageReader) { return $pageReader->read($page->getId()); @@ -124,7 +124,7 @@ public function readChildPagesContent(): static public function readChildDatabasesContent(): static { if ($this->hasChildDatabases()) { - $databaseReader = app(\RedberryProducts\MdNotion\Services\DatabaseReader::class); + $databaseReader = app(\Redberry\MdNotion\Services\DatabaseReader::class); $this->setChildDatabases( $this->getChildDatabases()->map(function (Database $database) use ($databaseReader) { return $databaseReader->read($database->getId()); @@ -161,7 +161,7 @@ public function readAllPagesContent(): static */ public function fetch(): static { - $pageReader = app(\RedberryProducts\MdNotion\Services\PageReader::class); + $pageReader = app(\Redberry\MdNotion\Services\PageReader::class); $fetchedPage = $pageReader->read($this->getId()); // Copy all data from the fetched page to this instance diff --git a/src/SDK/Notion.php b/src/SDK/Notion.php index b2b311e..c75282b 100644 --- a/src/SDK/Notion.php +++ b/src/SDK/Notion.php @@ -1,8 +1,8 @@ mockPageReader = Mockery::mock(PageReader::class); @@ -41,5 +41,5 @@ $mdNotion = MdNotion::make($pageId); - expect($mdNotion)->toBeInstanceOf(\RedberryProducts\MdNotion\MdNotion::class); + expect($mdNotion)->toBeInstanceOf(\Redberry\MdNotion\MdNotion::class); }); diff --git a/tests/MdNotionTest.php b/tests/MdNotionTest.php index 173f5c9..670a508 100644 --- a/tests/MdNotionTest.php +++ b/tests/MdNotionTest.php @@ -1,10 +1,10 @@ mockDatabaseReader = Mockery::mock(DatabaseReader::class); diff --git a/tests/Objects/IconTest.php b/tests/Objects/IconTest.php index c8229b2..0a4cb28 100644 --- a/tests/Objects/IconTest.php +++ b/tests/Objects/IconTest.php @@ -1,7 +1,7 @@ mockPageReader = Mockery::mock(PageReader::class); diff --git a/tests/Objects/RenderTitleTest.php b/tests/Objects/RenderTitleTest.php index d887e9c..d6a4c17 100644 --- a/tests/Objects/RenderTitleTest.php +++ b/tests/Objects/RenderTitleTest.php @@ -1,7 +1,7 @@ in(__DIR__); diff --git a/tests/SDK/Requests/AddCommentToPageRequestTest.php b/tests/SDK/Requests/AddCommentToPageRequestTest.php index 01d11db..c05228b 100644 --- a/tests/SDK/Requests/AddCommentToPageRequestTest.php +++ b/tests/SDK/Requests/AddCommentToPageRequestTest.php @@ -1,7 +1,7 @@ \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); @@ -15,14 +15,14 @@ $adapter = $registry->resolve('paragraph'); - expect($adapter)->toBeInstanceOf(\RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class); + expect($adapter)->toBeInstanceOf(\Redberry\MdNotion\Adapters\ParagraphAdapter::class); }); test('block registry returns registered block types', function () { $notion = new Notion('test-key', '2022-06-28'); $adapterMap = [ - 'paragraph' => \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, - 'heading_1' => \RedberryProducts\MdNotion\Adapters\HeadingAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, + 'heading_1' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); diff --git a/tests/Services/DatabaseReaderTest.php b/tests/Services/DatabaseReaderTest.php index 98e84fa..55f2620 100644 --- a/tests/Services/DatabaseReaderTest.php +++ b/tests/Services/DatabaseReaderTest.php @@ -1,9 +1,9 @@ 'test-page-id']); diff --git a/tests/Services/PageReaderTest.php b/tests/Services/PageReaderTest.php index 322d263..c99f5a7 100644 --- a/tests/Services/PageReaderTest.php +++ b/tests/Services/PageReaderTest.php @@ -1,9 +1,9 @@ \RedberryProducts\MdNotion\Adapters\ParagraphAdapter::class, + 'paragraph' => \Redberry\MdNotion\Adapters\ParagraphAdapter::class, ]; $factory = new BlockAdapterFactory($notion, $adapterMap); $registry = new BlockRegistry($factory); diff --git a/tests/TestCase.php b/tests/TestCase.php index c8e6c36..6582465 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,10 +1,10 @@ 'RedberryProducts\\MdNotion\\Database\\Factories\\'.class_basename($modelName).'Factory' + fn (string $modelName) => 'Redberry\\MdNotion\\Database\\Factories\\'.class_basename($modelName).'Factory' ); } From a5b6f66adde2ff8b2360a2d6f879386238122c85 Mon Sep 17 00:00:00 2001 From: maestroerror Date: Fri, 3 Oct 2025 17:12:40 +0400 Subject: [PATCH 2/6] Updated vendor name --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 48c41cd..5fd3fbd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Redberry +Copyright (c) RedberryProducts Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From e634e3c108769774d628d49ec7a4ce7fc4902f2e Mon Sep 17 00:00:00 2001 From: "Revaz Gh." Date: Fri, 3 Oct 2025 17:17:50 +0400 Subject: [PATCH 3/6] Update config/md-notion.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- config/md-notion.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/md-notion.php b/config/md-notion.php index d55e9f4..2a9a8c0 100644 --- a/config/md-notion.php +++ b/config/md-notion.php @@ -33,7 +33,7 @@ 'heading_3' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, 'bulleted_list_item' => \Redberry\MdNotion\Adapters\BulletedListItemAdapter::class, 'numbered_list_item' => \Redberry\MdNotion\Adapters\NumberedListItemAdapter::class, - 'to_do' => \Redberry\MdNotion\Adapters\ToDoAdapter::class, + 'to_do' => \Redberry\MdNotion\Adapters\TodoAdapter::class, 'toggle' => \Redberry\MdNotion\Adapters\ToggleAdapter::class, 'code' => \Redberry\MdNotion\Adapters\CodeAdapter::class, 'quote' => \Redberry\MdNotion\Adapters\QuoteAdapter::class, From 448ae356e66d4bc70eebb66e21e5c5878360bcea Mon Sep 17 00:00:00 2001 From: "Revaz Gh." Date: Fri, 3 Oct 2025 17:20:12 +0400 Subject: [PATCH 4/6] Update src/Adapters/ToggleAdapter.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Adapters/ToggleAdapter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Adapters/ToggleAdapter.php b/src/Adapters/ToggleAdapter.php index 80efa9c..683725f 100644 --- a/src/Adapters/ToggleAdapter.php +++ b/src/Adapters/ToggleAdapter.php @@ -32,7 +32,8 @@ protected function prepareData(array $block): array foreach ($contentBlocks['results'] as $childBlock) { // Create adapter based on block type $type = $childBlock['type']; - $adapterClass = '\\Redberry\\MdNotion\\Adapters\\'.ucfirst($type).'Adapter'; + $className = str_replace('_', '', ucwords($type, '_')); + $adapterClass = '\\Redberry\\MdNotion\\Adapters\\' . $className . 'Adapter'; if (class_exists($adapterClass)) { $adapter = new $adapterClass; } else { From 69add1e25710d3974b46f070be3d810d265a355b Mon Sep 17 00:00:00 2001 From: MaestroError <46760939+MaestroError@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:20:35 +0000 Subject: [PATCH 5/6] Fix styling --- src/Adapters/ToggleAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/ToggleAdapter.php b/src/Adapters/ToggleAdapter.php index 683725f..96e922b 100644 --- a/src/Adapters/ToggleAdapter.php +++ b/src/Adapters/ToggleAdapter.php @@ -33,7 +33,7 @@ protected function prepareData(array $block): array // Create adapter based on block type $type = $childBlock['type']; $className = str_replace('_', '', ucwords($type, '_')); - $adapterClass = '\\Redberry\\MdNotion\\Adapters\\' . $className . 'Adapter'; + $adapterClass = '\\Redberry\\MdNotion\\Adapters\\'.$className.'Adapter'; if (class_exists($adapterClass)) { $adapter = new $adapterClass; } else { From 9c7e16d617be4d66df142575f5d74281f7305726 Mon Sep 17 00:00:00 2001 From: maestroerror Date: Fri, 3 Oct 2025 17:24:54 +0400 Subject: [PATCH 6/6] Fixes --- config/md-notion.php | 2 +- src/Adapters/{TodoAdapter.php => ToDoAdapter.php} | 2 +- .../Adapters/{TodoAdapterTest.php => ToDoAdapterTest.php} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/Adapters/{TodoAdapter.php => ToDoAdapter.php} (92%) rename tests/Adapters/{TodoAdapterTest.php => ToDoAdapterTest.php} (96%) diff --git a/config/md-notion.php b/config/md-notion.php index 2a9a8c0..d55e9f4 100644 --- a/config/md-notion.php +++ b/config/md-notion.php @@ -33,7 +33,7 @@ 'heading_3' => \Redberry\MdNotion\Adapters\HeadingAdapter::class, 'bulleted_list_item' => \Redberry\MdNotion\Adapters\BulletedListItemAdapter::class, 'numbered_list_item' => \Redberry\MdNotion\Adapters\NumberedListItemAdapter::class, - 'to_do' => \Redberry\MdNotion\Adapters\TodoAdapter::class, + 'to_do' => \Redberry\MdNotion\Adapters\ToDoAdapter::class, 'toggle' => \Redberry\MdNotion\Adapters\ToggleAdapter::class, 'code' => \Redberry\MdNotion\Adapters\CodeAdapter::class, 'quote' => \Redberry\MdNotion\Adapters\QuoteAdapter::class, diff --git a/src/Adapters/TodoAdapter.php b/src/Adapters/ToDoAdapter.php similarity index 92% rename from src/Adapters/TodoAdapter.php rename to src/Adapters/ToDoAdapter.php index 1f018b1..322eec6 100644 --- a/src/Adapters/TodoAdapter.php +++ b/src/Adapters/ToDoAdapter.php @@ -4,7 +4,7 @@ use Redberry\MdNotion\DTOs\TodoDTO; -class TodoAdapter extends BaseBlockAdapter +class ToDoAdapter extends BaseBlockAdapter { public function getType(): string { diff --git a/tests/Adapters/TodoAdapterTest.php b/tests/Adapters/ToDoAdapterTest.php similarity index 96% rename from tests/Adapters/TodoAdapterTest.php rename to tests/Adapters/ToDoAdapterTest.php index 57409e7..1125be6 100644 --- a/tests/Adapters/TodoAdapterTest.php +++ b/tests/Adapters/ToDoAdapterTest.php @@ -1,6 +1,6 @@ toMarkdown($block); expect($markdown)->toBe('- [ ] To do 1'); @@ -70,7 +70,7 @@ ], ]; - $adapter = new TodoAdapter; + $adapter = new ToDoAdapter; $markdown = $adapter->toMarkdown($block); expect($markdown)->toBe('- [x] Completed task'); @@ -124,7 +124,7 @@ ], ]; - $adapter = new TodoAdapter; + $adapter = new ToDoAdapter; $markdown = $adapter->toMarkdown($block); expect($markdown)->toBe('- [x] **Formatted** _todo item_');