From 478ec9249110fd218b096c5f26dd84fd2d6591d1 Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 20 Aug 2021 11:27:03 +0800 Subject: [PATCH] Make widget's property sequence and length readonly. --- var/Typecho/Widget.php | 58 +++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/var/Typecho/Widget.php b/var/Typecho/Widget.php index 35011d31..fbef5289 100644 --- a/var/Typecho/Widget.php +++ b/var/Typecho/Widget.php @@ -300,28 +300,6 @@ abstract class Typecho_Widget echo $args[(0 == $split ? $num : $split) - 1]; } - /** - * 输出顺序值 - * - * @access public - * @return void - */ - public function sequence() - { - echo $this->sequence; - } - - /** - * 输出数据长度 - * - * @access public - * @return void - */ - public function length() - { - echo $this->length; - } - /** * 返回堆栈是否为空 * @@ -408,22 +386,6 @@ abstract class Typecho_Widget $this->row[$name] = $value; } - /** - * @return int - */ - public function getSequence(): int - { - return $this->sequence; - } - - /** - * @return int - */ - public function getLength(): int - { - return $this->length; - } - /** * 验证堆栈值是否存在 * @@ -438,6 +400,26 @@ abstract class Typecho_Widget return isset($this->row[$name]); } + /** + * 输出顺序值 + * + * @return int + */ + public function ___sequence(): int + { + return $this->sequence; + } + + /** + * 输出数据长度 + * + * @return int + */ + public function ___length(): int + { + return $this->length; + } + /** * 解析回调 *