-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
The current implementation (in 2.4.0) of WordPressClient::_logError() requires callbacks to be closures or function strings. Thus it is not possible to attach a class method as callback, which would make it easier to separate the callback from a logger.
However, if the callbacks would called instead by call_user_func_array() any callable type would be possible:
private function _logError()
{
$callbacks = $this->_getCallback('error');
$event = array(
'event' => 'error',
'endpoint' => $this->_endPoint,
'request' => $this->_request,
'proxy' => $this->_proxyConfig,
'auth' => $this->_authConfig,
);
foreach($callbacks as $callback)
{
call_user_func_array($callback, array($this->_error, $event));
}
}Metadata
Metadata
Assignees
Labels
No labels