Compare commits

...

2 Commits

Author SHA1 Message Date
as2252258 d1adc532e1 eee 2026-07-03 16:08:07 +08:00
as2252258 ec22ac39a3 eee 2026-07-03 16:07:27 +08:00
+23
View File
@@ -2,6 +2,7 @@
namespace Kiri; namespace Kiri;
use Exception;
use Swoole\Coroutine; use Swoole\Coroutine;
@@ -40,4 +41,26 @@ class Client
return $this->abstracts->{$name}(...$arguments); return $this->abstracts->{$name}(...$arguments);
} }
/**
* @param string $name
* @return mixed
* @throws Exception
*/
public function __get(string $name)
{
// TODO: Implement __get() method.
$getter = 'get' . ucfirst($name);
if (method_exists($this, $getter)) {
return $this->$getter();
} else if (method_exists($this, $name)) {
return $this->$name();
} else if (property_exists($this, $name)) {
return $this->$name;
} else {
throw new Exception('Property|Method "' . $name . '" does not exist.');
}
}
} }