xmpp
xmpp copied to clipboard
Wrongly calling call_user_func with an array in eventmanager
There is an issue with this code in the eventmanager:
public function trigger($event, $caller, array $parameters)
...
$callbacks = array_merge($events, $this->events[self::WILDCARD]);
...
do {
$current = array_shift($callbacks);
call_user_func($current, $eventObject);
$current is usually an array which it shouldn't be (PHP Notice: Array to string conversion in /tmp/src/Event/EventManager.php on line 128)
Somehow I don't see an Issue here. $callbacks
should always be an array and that $current
is callable is checked when attaching to an event.