This commit is contained in:
2020-12-17 14:09:14 +08:00
parent 672a719dbd
commit 36c1d0502a
151 changed files with 1937 additions and 2848 deletions
+8 -8
View File
@@ -28,23 +28,23 @@ class Application extends HttpService
}
/**
* @param $methods
* @param $name
* @return mixed
* @throws Exception
*/
public function __get($methods)
public function __get($name): mixed
{
if (method_exists($this, $methods)) {
return $this->{$methods}();
if (method_exists($this, $name)) {
return $this->{$name}();
}
$handler = 'get' . ucfirst($methods);
$handler = 'get' . ucfirst($name);
if (method_exists($this, $handler)) {
return $this->{$handler}();
}
if (property_exists($this, $methods)) {
return $this->$methods;
if (property_exists($this, $name)) {
return $this->$name;
}
$message = sprintf('method %s::%s not exists.', get_called_class(), $methods);
$message = sprintf('method %s::%s not exists.', get_called_class(), $name);
throw new Exception($message);
}