From 5370494517012dbab864fa2124b35789cb8d1fc0 Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 29 Jan 2024 22:06:38 +0800 Subject: [PATCH] * zin: fix php type error in on class. --- lib/zin/core/on.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/zin/core/on.class.php b/lib/zin/core/on.class.php index 5419032e78..855c885944 100644 --- a/lib/zin/core/on.class.php +++ b/lib/zin/core/on.class.php @@ -58,10 +58,12 @@ class on extends jsCallback * @param string|null $selector As a delegate event selector. * @param array $options Event options. */ - public function __construct(string $event, ?string $selector = null, array $options = array()) + public function __construct(string $event, ?string $selector = null, ?array $options = array()) { parent::__construct('event', 'args'); + if(is_null($options)) $options = array(); + if(str_contains($event, '__')) { list($event, $flags) = explode('__', $event);