eee
This commit is contained in:
+7
-7
@@ -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.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user