Compare commits
4 Commits
b96bd159d3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| eb42c8e0a2 | |||
| 10de0d5e08 | |||
| d1adc532e1 | |||
| ec22ac39a3 |
+27
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Kiri;
|
||||
|
||||
use Exception;
|
||||
use Swoole\Coroutine;
|
||||
|
||||
|
||||
@@ -40,4 +41,30 @@ class Client
|
||||
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->abstracts, $getter)) {
|
||||
return $this->abstracts->$getter();
|
||||
}
|
||||
|
||||
if (method_exists($this->abstracts, $name)) {
|
||||
return $this->abstracts->$name();
|
||||
}
|
||||
|
||||
if (property_exists($this->abstracts, $name)) {
|
||||
return $this->abstracts->$name;
|
||||
}
|
||||
|
||||
throw new Exception('Property|Method "' . $name . '" does not exist.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user