From cb29bf9f203d8a6bd809c1ab98e303e954c5fca4 Mon Sep 17 00:00:00 2001 From: Daniel Ronkainen Date: Tue, 25 Mar 2025 20:04:57 +0100 Subject: [PATCH 1/2] Add DTO 3.0 support --- Dom/Document.php | 8 ++++++-- composer.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dom/Document.php b/Dom/Document.php index cb5c2a3..8407cc7 100755 --- a/Dom/Document.php +++ b/Dom/Document.php @@ -97,8 +97,10 @@ public function bindTag(string $tag, string $key, bool $prepend = false): Elemen /** * Create (append) element - * @param string $element HTML tag (without brackets) - * @param string $value add value to tag + * + * @param string $element HTML tag (without brackets) + * @param null $value add value to tag + * @param string|null $bind * @return ElementInterface */ public function create($element, $value = null, ?string $bind = null): ElementInterface @@ -172,6 +174,7 @@ public function getTag(string $key): ?string public function execute(?callable $call = null): string { $this->html = ""; + if (is_null($this->elements)) { if (method_exists($this, "withElement")) { $inst = $this->withElement(); @@ -181,6 +184,7 @@ public function execute(?callable $call = null): string if (is_array($this->elements)) { $this->build($this->elements, $call); } + return $this->html; } diff --git a/composer.json b/composer.json index 6bbf013..13b4253 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { "php": ">=8.0", - "maplephp/dto": "^2.0", + "maplephp/dto": "^3.0", "maplephp/container": "^1.0" }, "autoload": { From 211572bd6d8752af210b5993687ea2f45a023dbf Mon Sep 17 00:00:00 2001 From: Daniel Ronkainen Date: Tue, 25 Mar 2025 20:06:26 +0100 Subject: [PATCH 2/2] Add DTO v3.0.0 support --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 13b4253..07275fc 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "maplephp/swiftrender", "type": "library", - "version": "v2.0.0", + "version": "v2.0.1", "description": "PHP SwiftRender is a pure and highly portable PHP template library.", "keywords": ["output buffer", "template", "engine", "partials", "components", "views"], "homepage": "https://wazabii.se",