From ec22ac39a3b69c3b32984e561511fd842c5089f3 Mon Sep 17 00:00:00 2001 From: whwyy Date: Fri, 3 Jul 2026 16:07:27 +0800 Subject: [PATCH] eee --- Client.php | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/Client.php b/Client.php index 4cc9182..e12b159 100644 --- a/Client.php +++ b/Client.php @@ -2,6 +2,7 @@ namespace Kiri; +use Exception; use Swoole\Coroutine; @@ -15,11 +16,11 @@ class Client private CoroutineClient|CurlClient $abstracts; - /** - * @param string $host - * @param int $port - * @param bool $isSsl - */ + /** + * @param string $host + * @param int $port + * @param bool $isSsl + */ public function __construct(string $host, int $port, bool $isSsl = false) { if (class_exists(Coroutine::class) && Coroutine::getCid() > -1) { @@ -32,7 +33,7 @@ class Client /** * @param string $name - * @param array $arguments + * @param array $arguments * @return mixed */ public function __call(string $name, array $arguments) @@ -40,4 +41,26 @@ class Client return $this->abstracts->{$name}(...$arguments); } + + + /** + * @param string $name + * @return mixed + * @throws Exception + */ + public function __get(string $name) + { + // TODO: Implement __get() method. + if (method_exists($this, $name)) { + return $this->$name(); + } + + + if (property_exists($this, $name)) { + return $this->$name; + } + + throw new Exception('Property|Method "' . $name . '" does not exist.'); + } + }