From abd43aa7ff543a8a8e8c100db774da86bdcc7847 Mon Sep 17 00:00:00 2001 From: Roelof Roos Date: Sat, 16 Jul 2022 16:59:12 +0200 Subject: [PATCH 1/3] Changelog update --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd2965..c0dae44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +## [3.0.2] + +### Added +- Support for `spatie/image` version 2.x. + +## [3.0.1] + +### Fixed +- `composer.json` didn't require PHP 8.1+, but the codebase did. + +## [3.0.0] + ### Added - Nova 4 support - `NovaEditorJsConverter` to split HTML conversion from the Nova Field @@ -48,7 +60,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 For older changes before v2.0.0, please see the [releases page](https://github.com/advoor/nova-editor-js/releases). -[unreleased]: https://github.com/advoor/nova-editor-js/compare/v2.0.3..master +[unreleased]: https://github.com/advoor/nova-editor-js/compare/v3.0.2..master +[3.0.2]: https://github.com/advoor/nova-editor-js/releases/v3.0.2 +[3.0.1]: https://github.com/advoor/nova-editor-js/releases/v3.0.1 +[3.0.0]: https://github.com/advoor/nova-editor-js/releases/v3.0.0 [2.0.3]: https://github.com/advoor/nova-editor-js/releases/v2.0.3 [2.0.2]: https://github.com/advoor/nova-editor-js/releases/v2.0.2 [2.0.0]: https://github.com/advoor/nova-editor-js/releases/v2.0.0 From 0f4b07c6793d6ee0ddf3c5af7b1903f2ad85dc2e Mon Sep 17 00:00:00 2001 From: Roelof Roos Date: Sat, 16 Jul 2022 16:38:30 +0200 Subject: [PATCH 2/3] Increased safety of NovaEditorJsData constructor --- CHANGELOG.md | 3 +++ src/NovaEditorJsData.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0dae44..ca3cc69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Fixed +- Constructor of `NovaEditorJsData` now accepts null values and non-iterables. + ## [3.0.2] ### Added diff --git a/src/NovaEditorJsData.php b/src/NovaEditorJsData.php index f8c8bd1..02bd9c5 100644 --- a/src/NovaEditorJsData.php +++ b/src/NovaEditorJsData.php @@ -4,6 +4,7 @@ use Advoor\NovaEditorJs\NovaEditorJs; use Illuminate\Contracts\Support\Htmlable; +use Illuminate\Support\Arr; use Illuminate\Support\Fluent; use Stringable; @@ -22,6 +23,10 @@ public function __construct($attributes = []) $attributes = json_decode($attributes); } + if (! is_iterable($attributes)) { + $attributes = Arr::wrap($attributes); + } + foreach ($attributes as $key => $value) { $this->attributes[$key] = $value; } From 13d8d8deb34d2f7bc609c1fb0965940db8130b21 Mon Sep 17 00:00:00 2001 From: Roelof Roos Date: Sat, 16 Jul 2022 16:41:21 +0200 Subject: [PATCH 3/3] Fixed wrong phpdoc --- CHANGELOG.md | 1 + src/NovaEditorJsData.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca3cc69..bb4a5a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Constructor of `NovaEditorJsData` now accepts null values and non-iterables. +- PHPDoc return type of `NovaEditorJsData::toHtml()`. ## [3.0.2] diff --git a/src/NovaEditorJsData.php b/src/NovaEditorJsData.php index 02bd9c5..f30ff75 100644 --- a/src/NovaEditorJsData.php +++ b/src/NovaEditorJsData.php @@ -33,7 +33,7 @@ public function __construct($attributes = []) } /** - * @return \Advoor\NovaEditorJs\HtmlString + * @return \Illuminate\Support\HtmlString */ public function toHtml() {