|
@@ -271,7 +271,7 @@ class TcpConnection extends ConnectionInterface
|
|
|
*/
|
|
*/
|
|
|
public function __call($name, array $arguments) {
|
|
public function __call($name, array $arguments) {
|
|
|
// Try to emit custom function within protocol
|
|
// Try to emit custom function within protocol
|
|
|
- if (\method_exists($this->protocol, $name)) {
|
|
|
|
|
|
|
+ if (\is_callable($this->protocol, $name)) {
|
|
|
try {
|
|
try {
|
|
|
return \call_user_func(array($this->protocol, $name), $this, $arguments);
|
|
return \call_user_func(array($this->protocol, $name), $this, $arguments);
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
@@ -961,7 +961,7 @@ class TcpConnection extends ConnectionInterface
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// Try to emit protocol::onClose
|
|
// Try to emit protocol::onClose
|
|
|
- if ($this->protocol && \method_exists($this->protocol, 'onClose')) {
|
|
|
|
|
|
|
+ if ($this->protocol && \is_callable($this->protocol, 'onClose')) {
|
|
|
try {
|
|
try {
|
|
|
\call_user_func(array($this->protocol, 'onClose'), $this);
|
|
\call_user_func(array($this->protocol, 'onClose'), $this);
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|