This commit is contained in:
2026-07-03 16:08:07 +08:00
parent ec22ac39a3
commit d1adc532e1
+7 -7
View File
@@ -51,16 +51,16 @@ class Client
public function __get(string $name) public function __get(string $name)
{ {
// TODO: Implement __get() method. // TODO: Implement __get() method.
if (method_exists($this, $name)) { $getter = 'get' . ucfirst($name);
if (method_exists($this, $getter)) {
return $this->$getter();
} else if (method_exists($this, $name)) {
return $this->$name(); return $this->$name();
} } else if (property_exists($this, $name)) {
if (property_exists($this, $name)) {
return $this->$name; return $this->$name;
} } else {
throw new Exception('Property|Method "' . $name . '" does not exist.'); throw new Exception('Property|Method "' . $name . '" does not exist.');
} }
}
} }