From c1bb1fe2bb9db3fa79942e1ae335624a9e3e1c04 Mon Sep 17 00:00:00 2001 From: sunhao Date: Wed, 28 Feb 2024 10:54:49 +0800 Subject: [PATCH] * zin: rename empty to clear to compatible with php 5.6. --- lib/zin/core/command.class.php | 8 ++++---- lib/zin/core/jquery.class.php | 4 ++-- lib/zin/core/node.class.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/zin/core/command.class.php b/lib/zin/core/command.class.php index f6331bbdab..77cdab39e9 100644 --- a/lib/zin/core/command.class.php +++ b/lib/zin/core/command.class.php @@ -49,7 +49,7 @@ class command public static function html(node $node, mixed ...$codes) { - $node->empty(); + $node->clear(); $node->add(html(...$codes)); } @@ -65,13 +65,13 @@ class command public static function text(node $node, mixed ...$args) { - $node->empty(); + $node->clear(); $node->add(text(...$args)); } - public static function empty(node $node) + public static function clear(node $node) { - $node->empty(); + $node->clear(); } public static function prepend(node $node, mixed ...$args) diff --git a/lib/zin/core/jquery.class.php b/lib/zin/core/jquery.class.php index 80e086aed5..b400fcdcd2 100644 --- a/lib/zin/core/jquery.class.php +++ b/lib/zin/core/jquery.class.php @@ -298,9 +298,9 @@ class jQuery extends jsContext * @access public * @return self */ - public function empty(): self + public function clear(): self { - return $this->call('empty'); + return $this->call('clear'); } /** diff --git a/lib/zin/core/node.class.php b/lib/zin/core/node.class.php index d1c19ff922..e3c620afdd 100644 --- a/lib/zin/core/node.class.php +++ b/lib/zin/core/node.class.php @@ -332,7 +332,7 @@ class node implements \JsonSerializable $this->removed = true; } - public function empty(?string $blockName = null) + public function clear(?string $blockName = null) { if($blockName) unset($this->blocks[$blockName]); else $this->blocks = array();